Adding Languages

Updated: last quarter · 1 min read

Deprecated

These docs cover the legacy CLI (v0). The current CLI is v1. See the current CLI docs

Add new target languages by updating the targets array in i18n.json and running the CLI. Complete translation files are generated for new locales, while existing translations remain unchanged.

Add a language#

Update your i18n.json configuration:

json
{
  "locale": {
    "source": "en",
    "targets": ["es", "fr", "de"]
  }
}

Run the CLI:

bash
npx lingo.dev@latest run

The CLI creates complete translation files for each new locale:

text
locales/
  en.json    (source - unchanged)
  es.json    (existing - unchanged)
  fr.json    (existing - unchanged)
  de.json    (new - fully translated)

Existing vs. new languages#

The CLI handles existing and new languages differently:

Existing languagesNew languages
BehaviorOnly missing keys are translatedComplete files are generated from scratch
Existing contentPreservedN/A

Regional variants#

The CLI supports regional language variants using BCP 47 tags:

json
{
  "locale": {
    "source": "en-US",
    "targets": ["en-GB", "es-ES", "es-MX", "fr-FR", "fr-CA", "pt-BR", "pt-PT"]
  }
}

Each variant gets a distinct translation file with region-appropriate terminology, spelling, and tone.

Targeted generation#

Generate translations for a specific language without processing all targets:

bash
npx lingo.dev@latest run --target-locale de

This is useful when adding one language at a time to review quality before expanding further.

Removing languages#

Remove a locale from the targets array and the CLI stops processing it. Existing files are not deleted - remove them manually if needed.

Next Steps#