The Lingo.dev CLI provides manual retranslation options for refreshing translations when the source text hasn't changed - after switching AI models, updating translation prompts, or improving localization engine configuration.
For automatic retranslation triggered by source text changes, see Automatic Retranslation.
Complete retranslation#
Bypass the lockfile and retranslate all content:
npx lingo.dev@latest run --forceThis retranslates every key in every target language and recreates the i18n.lock file.
Targeted retranslation#
By language#
npx lingo.dev@latest run --force --target-locale esRetranslates only Spanish while preserving all other languages.
By bucket type#
npx lingo.dev@latest run --force --bucket jsonRetranslates only JSON files, leaving Markdown and other formats unchanged.
By key#
npx lingo.dev@latest run --force --key welcome.titleRetranslates a single key across all target languages. Supports glob patterns.
By file#
npx lingo.dev@latest run --force --file blog.[locale].jsonRetranslates specific files. Multiple --file flags can be combined.
Combined#
npx lingo.dev@latest run --force --bucket json --target-locale esOptions combine for precise control - this retranslates all JSON content for Spanish only.
Efficient retranslation with purge#
For best performance, use purge before run instead of --force. This leverages the CLI's built-in caching mechanism:
# Remove existing translations for a specific key
npx lingo.dev@latest purge --key welcome.title
# Then regenerate (without --force)
npx lingo.dev@latest runWhen to retranslate#
| Scenario | Recommended approach |
|---|---|
| Source text changed | Automatic - no action needed |
| Switched AI models | run --force or targeted retranslation |
| Updated translation prompts | run --force or targeted retranslation |
| Improved engine configuration | Targeted retranslation for affected locales |
| Poor quality in specific locale | run --force --target-locale <locale> |
