# Multilingual URL Behavior

## Multilingual URL Behavior

**Files:** `src/config/language.json`, `src/config/config.toml`, `src/lib/utils/i18nUtils.ts` · **Skill level:** Beginner

Lumio’s multilingual system is easy to misread because there are three different layers involved:

1. `src/config/language.json`
2. `settings.multilingual` in `config.toml`
3. helper logic in `src/lib/utils/i18nUtils.ts`

### Language Definitions

The available languages come from:

```json
[
  {
    "languageName": "En",
    "languageCode": "en",
    "contentDir": "english",
    "dir": "ltr",
    "ogLocale": "en_US",
    "dateLocale": "en-US",
    "weight": 1
  },
  {
    "languageName": "Fr",
    "languageCode": "fr",
    "contentDir": "french",
    "dir": "ltr",
    "ogLocale": "fr_FR",
    "dateLocale": "fr-FR",
    "weight": 2
  },
  {
    "languageName": "العربية",
    "languageCode": "ar",
    "contentDir": "arabic",
    "dir": "rtl",
    "ogLocale": "ar_SA",
    "dateLocale": "ar",
    "weight": 3
  }
]
```

To add or remove a language, see [Internationalization](../../customization/internationalization/). For right-to-left languages, see [RTL & Arabic](../../features/rtl-arabic/).

### Main Multilingual Settings

In `src/config/config.toml`:

```toml
[settings.multilingual]
  enable = true
  defaultLanguage = "en"
  disableLanguages = []
  showDefaultLangInUrl = false
```

### What `showDefaultLangInUrl = false` Means

This is the setting that confuses most people.

When it is `false`:

- English pages use URLs like `/about/`
- Other languages use URLs like `/fr/about/` and `/ar/about/`

When it is `true`:

- English pages use `/en/about/`
- Other languages use URLs like `/fr/about/` and `/ar/about/`

### How Static Paths Are Generated

Lumio uses helper functions like `generatePaths()` and `supportedLanguages` from `i18nUtils.ts`.

Those helpers decide whether the language param becomes:

- `undefined` for the default language
- or an explicit code such as `fr` or `ar`

based on `showDefaultLangInUrl`.

### Localized URLs In Components

Links are usually generated with:

```ts
getLocaleUrlCTM("/contact/", Astro.currentLocale)
```

That helper also:

- keeps external links untouched
- handles `mailto:` and `tel:`
- strips `.md`/`.mdx` endings
- applies trailing slash behavior

### Practical Editing Advice

If links look wrong after enabling or disabling multilingual mode:

1. check `language.json`
2. check `settings.multilingual` in `config.toml`
3. restart dev so config-derived logic fully refreshes
4. make sure your content exists in the expected language folders