Skip to content
New: Customize your theme with an AI assistant. Read the guide

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

PartFiles
The language itselfan entry in src/config/language.json
Page and section texta folder per language in every content folder, such as src/content/sections/french/ and src/content/practice-areas/arabic/
Interface textsrc/i18n/<lang>.json, such as fr.json: buttons, labels, form messages, the address and opening hours, the tagline
Menussrc/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
}
KeyWhat it does
languageNameThe name in the language menus
languageCodeThe URL prefix and the file suffix (fr.json, menu.fr.json)
contentDirThe folder name inside each content folder
dirltr or rtl. This one value sets the direction of every page in the language
ogLocaleThe language of social previews
dateLocaleHow dates and numbers are written, for example “4 November 2026” or “4 novembre 2026”
weightThe 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

src/config/config.toml
[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”) in src/i18n/fr.json.
  • Address and opening hours: contactInfo.address in each src/i18n/<lang>.json. The hours visitors see are in contactLines.hours in src/content/sections/<language>/contact-split-form.md and in each office file, so translate them there (see Firm Info). The phone and email are set once in [settings.contactInfo] in config.toml.
  • Menus: keep each menu.<lang>.json in step with menu.en.json: the same items, in the same order, with the same url. Translate the name and description values.
  • Page titles: every title ends with the tagline in the page’s language. For the default language it is tagline in [site] in config.toml. The others use common.tagline in their src/i18n/<lang>.json. Keep common.tagline in en.json the same as the config value.

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>.jsonWhat it sets
common.priceFormatWhere the currency goes: “£1,250” in English, “1 250 £” in French, “1,250 £” in Arabic
common.colonThe 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

  1. 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_DE

    For a right-to-left language, add --dir rtl. The command adds the entry to language.json and copies the default language’s content folders, menu file, and i18n file. It keeps files that already exist unless you add --force.

  2. Translate the new german/ folders, src/config/menu.de.json, and src/i18n/de.json.

  3. Restart the dev server and open /de/.

  4. On Netlify, add a /de/* block to netlify.toml like 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 = false under [settings.multilingual], run npm run dev once, then run:

    Terminal window
    npm run remove-multilingual

    It 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:

ScriptWhat it checks
scripts/check-i18n-keys.mjsEvery src/i18n/<lang>.json file has the same keys
scripts/check-localized-links.mjsNo link in the built site leaves its language
scripts/check-hreflang.mjsEvery 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 is
src/content/[COLLECTION]/english/[FILE NAME]. Edit the file with the same name in
src/content/[COLLECTION]/french/. Keep every key, slug, image path, link and number
exactly as it is, and translate only the text values. Write internal links without
a language prefix. Use a no-break space before the currency symbol in prices.
Then run npm run astro-check.
Type something to search...