Add and manage CLI v0 locales

Select the intended language variant, add a legacy target, and verify its file and application behavior.

In v0, locale.source names the original language and locale.targets selects recurring translation targets. Choose the variant your readers need, then check that configuration, filenames, backend, and application use it consistently.

Add one target #

To add German to existing Spanish and French coverage, edit i18n.json:

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

Run the installed v0 binary for that target:

sh
lingo run --target-locale de

The flag overrides the target list for this run and can select a locale absent from config. Add it to config for future runs. A separate-file pattern locales/[locale].json writes locales/de.json; inspect the values and load that file in the application before enabling German for readers.

A missing target needs all selected keys. A present target normally keeps existing values and fills missing keys, though changed source can still require retranslation. Avoid combining a first language addition with broad force when other accepted locales should remain unchanged.

Target-locale scope does not refresh an existing source-checksum baseline. A later ordinary run can revisit changed source, so use the settlement rules before assuming a scoped review permanently settles it.

Use region and script where they matter #

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

Region-qualified locales distinguish requested conventions: English color/colour, Spanish ordenador/computadora, and Portuguese trem/comboio illustrate why a language-only choice can be insufficient. Usage still depends on context; a tag does not guarantee that every generated expression fits the audience. Chinese can also need script or region distinctions such as zh-Hans or zh-TW.

Inspect the installed generation's lists:

sh
lingo show locale sources
lingo show locale targets

Those lists do not establish every backend's acceptance or quality. Verify the chosen pair with a small run before expanding it, rather than relying on a historical language count.

Separate language identity from file layout #

Legacy handling normalizes several platform spellings for API requests. Files can still need underscore or Android resource naming. Use the delimiter setting and the format's layout, then inspect the actual output location.

Translation does not set dir, mirror controls, or add routing. Arabic, Hebrew, Persian, and Urdu commonly need RTL presentation; check the consuming interface, including embedded numbers and identifiers. The application must recognize a new locale as well as load its content.

Remove a target #

Removing a code from locale.targets stops future selection. Existing files remain. Decide separately whether to retain, stop serving, or delete them. Purge is destructive and can select source content; it is not the same operation as removing a configured locale.