Multilingual URL Behavior
Techbyte’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": "English", "languageCode": "en", "contentDir": "english", "dir": "ltr", "ogLocale": "en_US", "dateLocale": "en-US", "weight": 1 }, { "languageName": "Français", "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 }]For how right-to-left works, 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 still use
/fr/about/and/ar/about/
How Static Paths Are Generated
Techbyte 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
fr
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
Removing Languages
To remove one language, add its code to disableLanguages in [settings.multilingual], and restart dev. Its files stay in the project.
To keep only your default language:
- Astro: set
enable = falsein[settings.multilingual], runnpm run devonce, then runnpm run remove-multilingual. - Tina: set
enable = false, then runnpm run toml:watch,npm run remove-multilingual, andnpm run tina:generate. - Sanity: run
npm run remove-multilingual. The other languages’ documents stay in your project unless you add-- --delete-online, which deletes them and can’t be undone.
In the Astro and Tina editions, remove-multilingual also removes those languages’ blocks from netlify.toml. In the Sanity edition, delete those blocks yourself if you host on Netlify.
To add a language, see Internationalization. In all three editions, the script adds the new language’s block to netlify.toml.
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/). A language with a missing file shows the default language’s text