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:
src/config/language.jsonsettings.multilingualinconfig.toml- helper logic in
src/lib/utils/i18nUtils.ts
Language Definitions
The available languages come from:
[ { "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. For right-to-left languages, see RTL & Arabic.
Main Multilingual Settings
In src/config/config.toml:
[settings.multilingual] enable = true defaultLanguage = "en" disableLanguages = [] showDefaultLangInUrl = falseWhatshowDefaultLangInUrl = falseMeans
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:
undefinedfor the default language- or an explicit code such as
frorar
based on showDefaultLangInUrl.
Localized URLs In Components
Links are usually generated with:
getLocaleUrlCTM("/contact/", Astro.currentLocale)That helper also:
- keeps external links untouched
- handles
mailto:andtel: - strips
.md/.mdxendings - applies trailing slash behavior
Practical Editing Advice
If links look wrong after enabling or disabling multilingual mode:
- check
language.json - check
settings.multilingualinconfig.toml - restart dev so config-derived logic fully refreshes
- make sure your content exists in the expected language folders