Translation Overrides
Lingo.dev CLI allows you to manually override translations by directly editing target files. Once overridden, these custom translations are preserved across subsequent CLI runs unless the source content changes.
How Overrides Work
Lingo.dev CLI uses content fingerprinting to detect changes. When you manually edit a translation in a target file, the CLI preserves your changes because the source content fingerprint remains unchanged.
Example workflow:
- Initial translation — CLI generates Spanish translation:
// locales/en.json (source)
{
"greeting": "Welcome to our platform"
}
// locales/es.json (generated)
{
"greeting": "Bienvenido a nuestra plataforma"
}
- Manual override — You edit the Spanish translation:
// locales/es.json (manually edited)
{
"greeting": "¡Bienvenido a nuestro espacio digital!"
}
- Subsequent CLI runs — Your override is preserved:
npx lingo.dev@latest i18n
# Your custom Spanish translation remains unchanged
- Source changes trigger retranslation — If you modify the English source:
// locales/en.json (source modified)
{
"greeting": "Welcome to our new platform"
}
The CLI detects the source change and retranslates, replacing your override with a new AI-generated translation.
Key Renaming Support
Lingo.dev CLI preserves translations even when you rename keys. The lockfile tracks both content and key fingerprints, enabling seamless key refactoring without losing translation work.
Learn more: Key Renaming