Multilingual URL Behavior
Techlo’s multilingual system is easy to misread because there are three different layers involved. In the Tina and Sanity editions, settings.multilingual and language.json stay in the project:
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 }]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/ - French pages use URLs like
/fr/about/ - Arabic pages use URLs like
/ar/about/
When it is true:
- English pages use
/en/about/ - French pages use
/fr/about/ - Arabic pages use
/ar/about/
How Static Paths Are Generated
Techlo 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
Disabling Multilingual
If you only need one language, the steps differ by edition. In the Astro edition:
- set
settings.multilingual.enable = falseinconfig.toml - run
npm run toml:watchonce - run
npm run remove-multilingualto remove the extra language content files
Internationalization has the Tina and Sanity steps, and how to turn off one language with disableLanguages.
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 (
english/,french/,arabic/)