Adding Languages
Deprecated
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:
{
"locale": {
"source": "en",
"targets": ["es", "fr", "de"]
}
}Run the CLI:
npx lingo.dev@latest runThe CLI creates complete translation files for each new locale:
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 languages | New languages | |
|---|---|---|
| Behavior | Only missing keys are translated | Complete files are generated from scratch |
| Existing content | Preserved | N/A |
Regional variants#
The CLI supports regional language variants using BCP 47 tags:
{
"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:
npx lingo.dev@latest run --target-locale deThis 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.