Internationalization
Files: src/config/language.json, src/config/config.toml, src/i18n/<lang>.json, src/config/menu.<lang>.json, src/content/**/<language>/ · Skill level: Beginner
Covena ships in English (the default, at /), French (at /fr/), and Arabic (at /ar/, right to left). Every page, menu, and label exists in all three. You can keep all three, switch one off, keep only your default language, or add another one. For how right-to-left pages work, see RTL & Arabic.
What Makes Up A Language
| Part | Files |
|---|---|
| The language itself | an entry in src/config/language.json |
| Page and section text | a folder per language in every content folder, such as src/content/sections/french/ and src/content/practice-areas/arabic/ |
| Interface text | src/i18n/<lang>.json, such as fr.json: buttons, labels, form messages, the address and opening hours, the tagline |
| Menus | src/config/menu.<lang>.json, such as menu.ar.json |
<language> is a folder name (english, french, arabic) and <lang> is a language code (en, fr, ar). Each language is edited on its own: changing an English file does not change the French or Arabic one, and a missing translation does not fall back to English.
// src/config/language.json (the French entry){ "languageName": "Français", "languageCode": "fr", "contentDir": "french", "dir": "ltr", "ogLocale": "fr_FR", "dateLocale": "fr-FR", "weight": 2}| Key | What it does |
|---|---|
languageName | The name in the language menus |
languageCode | The URL prefix and the file suffix (fr.json, menu.fr.json) |
contentDir | The folder name inside each content folder |
dir | ltr or rtl. This one value sets the direction of every page in the language |
ogLocale | The language of social previews |
dateLocale | How dates and numbers are written, for example “4 November 2026” or “4 novembre 2026” |
weight | The order in the language menus |
Visitors switch language in the header (from 1320 px wide, when showLanguageSwitcher = true under [settings.header]), in the mobile menu, and in the footer, which has a language menu on every page. The menu opens the same page in the other language.
Language Settings
[settings.multilingual] enable = true defaultLanguage = "en" disableLanguages = [""] # e.g. ["ar"] switches Arabic off without deleting it showDefaultLangInUrl = false # true puts English at /en/ instead of /Restart npm run dev after you change any of these.
Translate Or Edit Text
- Page and section text: edit the file with the same name in the language’s folder, for example
src/content/sections/french/hero-portrait-navy.md. Keep the keys and the structure as they are in English, and translate the values. - Interface text: edit the same key in the language’s file, for example
navigation.buttonLabel(“Free consultation”) insrc/i18n/fr.json. - Address and opening hours:
contactInfo.addressin eachsrc/i18n/<lang>.json. The hours visitors see are incontactLines.hoursinsrc/content/sections/<language>/contact-split-form.mdand in each office file, so translate them there (see Firm Info). The phone and email are set once in[settings.contactInfo]inconfig.toml. - Menus: keep each
menu.<lang>.jsonin step withmenu.en.json: the same items, in the same order, with the sameurl. Translate thenameanddescriptionvalues. - Page titles: every title ends with the tagline in the page’s language. For the default language it is
taglinein[site]inconfig.toml. The others usecommon.taglinein theirsrc/i18n/<lang>.json. Keepcommon.taglineinen.jsonthe same as the config value.
Links Keep Their Language
Write internal links without a language, like /fees/, in every language’s files. The theme adds the prefix, so the same link opens /fr/fees/ on a French page. This works for buttons, menus, and links in Markdown text. Never type /fr/ or /ar/ into content.
Numbers, Prices, And Dates
Figures that count up are written in the page’s format when the site builds: “1,250” and “4.9” in English and Arabic, “1 250” and “4,9” in French (with a narrow no-break space). In content you can write a figure either way. Put it in quotes to keep the thousands separator, such as "1,250".
Key in src/i18n/<lang>.json | What it sets |
|---|---|
common.priceFormat | Where the currency goes: “£1,250” in English, “1 250 £” in French, “1,250 £” in Arabic |
common.colon | The colon after labels. French puts a no-break space before it |
Dates follow dateLocale in language.json. When you write prices in running text, use the same pattern as priceFormat, with a no-break space before the symbol in French and Arabic.
Add A Language
-
Run the command with the code, the name, the folder, the date locale, and the social locale (German as the example):
Terminal window npm run generate-multilingual-content -- --lang de --name Deutsch --dir-name german --locale de-DE --og de_DEFor a right-to-left language, add
--dir rtl. The command adds the entry tolanguage.jsonand copies the default language’s content folders, menu file, and i18n file. It keeps files that already exist unless you add--force. -
Translate the new
german/folders,src/config/menu.de.json, andsrc/i18n/de.json. -
Restart the dev server and open
/de/. -
On Netlify, add a
/de/*block tonetlify.tomllike the/fr/*one, so missing German pages show the German 404 page.
Remove A Language
-
Switch one language off: add its code to
disableLanguages, for example["ar"]. The files stay, so you can turn it back on. -
Keep only your default language: set
enable = falseunder[settings.multilingual], runnpm run devonce, then run:Terminal window npm run remove-multilingualIt deletes every other language’s content folders, menu files, and i18n files, and keeps your default language, whichever it is. Commit or back up your project first, because this can’t be undone from inside the theme.
Check Your Translations
npm run verify runs every check in the theme, including three for languages:
| Script | What it checks |
|---|---|
scripts/check-i18n-keys.mjs | Every src/i18n/<lang>.json file has the same keys |
scripts/check-localized-links.mjs | No link in the built site leaves its language |
scripts/check-hreflang.mjs | Every language link in the page head points to a page that exists |
Do It With AI
Translate the Covena page [FILE NAME] into French. The English file issrc/content/[COLLECTION]/english/[FILE NAME]. Edit the file with the same name insrc/content/[COLLECTION]/french/. Keep every key, slug, image path, link and numberexactly as it is, and translate only the text values. Write internal links withouta language prefix. Use a no-break space before the currency symbol in prices.Then run npm run astro-check.