> For the complete documentation index, see [llms.txt](https://docs.themeupstudio.com/crimson/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.themeupstudio.com/crimson/multilingual/locales-main-locale-and-auto-redirect.md).

# Locales, Main Locale, and Auto Redirect

Crimson uses a simple set of inputs to define what languages exist and what URLs they map to.

### Locales

<figure><img src="/files/iSY8GCHcAoON9zqkoiU2" alt=""><figcaption><p>Locales</p></figcaption></figure>

**What it does**\
Locales tells Crimson which languages you offer and which flags to display. You enter a comma-separated list in the format:

`language-country`

**Examples**

* `en-GB` → English with UK flag
* `en-US` → English with US flag
* `hi-IN` → Hindi (India)
* `es-ES` → Spanish (Spain)

**How to fill it (recommended)**

* Use commas
* Avoid extra spaces (keep it clean)
* Choose country codes that match the audience you want to represent via the flag

***

### Main Locale

<figure><img src="/files/Nsya3MrK54yaVYM5RYjc" alt=""><figcaption><p>Main Locale</p></figcaption></figure>

**What it does**\
Main Locale tells Crimson which language is the default language of your site.

**What to enter**

* A two-letter language code like:
  * `en` for English
  * `hi` for Hindi

***

### Main Locale URL

<figure><img src="/files/ia8gxDRi3eu2vUu1bPXf" alt=""><figcaption><p>Main Locale URL</p></figcaption></figure>

**What it does**\
This is the root URL for your default language site, like:

`https://www.example.com`

**Critical rule**\
Crimson warns: **do not add a trailing slash** at the end of the Main Locale URL.

✅ Good:

* `https://example.com`

❌ Avoid:

* `https://example.com/`

***

### Auto Redirect on Locale

{% hint style="danger" %}
This setting is moved to Code Injection. Please visit [Code Injection](/crimson/getting-started/code-injection.md) and [Code Injection Variables](/crimson/getting-started/code-injection-variables.md) for setting this.
{% endhint %}

<figure><img src="/files/Aesj6qQOwXAtZZAyiZC4" alt=""><figcaption><p>Redirect on locale setting in Code Injection</p></figcaption></figure>

**What it does**\
If enabled, Crimson checks the visitor’s browser language and automatically sends them to the matching language site (if available).

**Example behavior**\
If you offer `en`, `hi`, `es`, and the visitor’s browser prefers Spanish:

* they may be redirected to `https://yourdomain.com/es`

**If you leave it OFF**

* everyone lands on your default language first
* visitors can switch manually using the language selector

***

### Optional: Locale Specific Domains

If you want language switching to use separate domains or subdomains instead of `/{lang}/` paths, configure the locale-domain variables in Code Injection. See [Locale-Specific Domains](/crimson/multilingual/locale-specific-domains.md).
