Skip to main content
Premium Tool

Site Locale Generator

Generate a complete locale structure for your entire website by defining language-region pairs and outputting hreflang-ready sitemaps.

Loading tool…

A quick orientation: this page explains how the site locale generator produces complete locale structures for an entire website, walks through the configuration steps, highlights the structural errors that undermine most locale rollouts, and describes how this tool differs from page-level hreflang generators.

What is a site locale generator?

A site locale generator creates the full locale configuration for a website — the set of language and region codes, URL patterns, fallback rules, and x-default assignments that define how every page on your site maps to its counterparts in other languages. Instead of configuring hreflang relationships one page at a time, you define the locale structure at the site level and the generator applies it globally.

Think of it as the architectural blueprint for your multilingual site. Before you generate individual hreflang tags or URL maps, you need to decide: which locales does this site support? What URL pattern does each locale use? Which locale is the x-default? How do new pages inherit locale assignments? The site locale generator answers all of these questions in a single, exportable configuration.

The output is a structured locale manifest — a JSON or YAML document that describes your site's complete locale topology. This manifest can drive automated hreflang tag generation, sitemap creation, and CMS locale configuration. It serves as the single source of truth for every downstream tool that needs to know which locales exist and how their URLs are structured.

All processing runs in the browser. Your site structure data stays on your machine and is never transmitted to any server.

How to use this site locale generator

Follow these steps to generate a complete locale structure:

  1. Enter your primary domain and locale. Start with your site's main domain (e.g., https://example.com) and its primary locale code (e.g., en or en-US). This becomes the base against which all other locales are defined.

  2. Add target locales. For each additional language or region your site supports, add a locale entry specifying the ISO 639-1 language code (with optional ISO 3166-1 region code) and the URL pattern. Supported patterns include subdirectory (/es/), subdomain (es.example.com), and separate domain (example.es).

  3. Configure x-default. Select which locale or URL serves as the x-default fallback for users whose language preferences don't match any declared locale. You can point x-default to an existing locale (commonly the English version) or to a dedicated language-selector page.

  4. Define page path rules. Specify how page paths translate between locales. Options include identical paths (same slug across locales), prefix substitution only (slug stays the same, only the locale prefix changes), or per-page mapping (for sites with translated slugs).

  5. Generate and export. The generator produces the complete locale manifest. Review the summary table showing all locales, their URL patterns, and x-default assignment. Export as JSON for integration with the hreflang tag generator or as YAML for CMS and CI/CD configuration files.

Common errors and how to fix them

These are the five structural mistakes that break most site-wide locale configurations.

  1. Overlapping locale codes. Defining both en (generic English) and en-US without also defining en-GB creates ambiguity: which locale handles British English users? The generator validates that your locale set is internally consistent and warns about gaps in regional coverage.

  2. Inconsistent URL pattern types. Mixing subdirectory locales with subdomain locales without clear documentation creates maintenance problems. The generator tracks which pattern type each locale uses and flags inconsistencies that could confuse automated tools.

  3. Missing x-default assignment. Omitting x-default means search engines have no fallback for users in unlisted locales. The generator requires an x-default entry before it will produce the final manifest.

  4. Duplicate locale assignments. Accidentally assigning the same locale code to two different URL patterns produces conflicting hreflang signals. The generator enforces unique locale codes across your entire site structure.

  5. Forgetting locale inheritance rules. When you add a new page to your site, it should automatically inherit the locale structure. The generator's manifest includes inheritance rules so downstream tools know how to handle new pages without manual configuration.

How this tool is different

Four things set this site locale generator apart from page-level tools and manual locale configuration:

Everything runs in your browser with no data leaving your machine. For deeper background on locale codes and hreflang architecture, see the what is hreflang guide.

Frequently asked questions

  • What is a site locale generator?
    It is a tool that takes your website’s page inventory and produces a complete locale-aware structure with hreflang annotations for every language-region you target.
  • How do I define which locales my site supports?
    Select from a comprehensive list of ISO language and region codes. The tool validates your selections and warns about uncommon or conflicting combinations.
  • Can I generate sitemaps for new locales I haven’t launched yet?
    Yes. Define your planned locales and the tool generates the complete structure in advance, ready to deploy when your translated content is live.
  • Does it support both language-only and language-region codes?
    Yes. Use codes like “es” for all Spanish speakers or “es-MX” to target Mexico specifically. The tool handles both in the same structure.
  • What output does the site locale generator produce?
    A complete XML sitemap with xhtml:link annotations, plus optional HTML link tags and HTTP header snippets for every page in every locale.
  • Can I import an existing sitemap as a starting point?
    Yes. Upload your current sitemap and the tool uses it as the base, extending it with alternate entries for every new locale you add.
  • How does it handle pages available in only some locales?
    You can mark per-page locale availability. The tool only generates alternate entries for locales where the page actually exists.
  • Does it set x-default for me?
    Yes. Choose your fallback locale and the tool includes x-default in every hreflang set across the entire site.
  • Can I export the structure as a CSV?
    Yes. Export as XML sitemap, CSV matrix, or copy individual code snippets — whichever format best fits your deployment process.
  • Is there a signup requirement?
    No. The site locale generator is fully accessible without registration, login, or payment.

Related tools