Smart Caching with i18n.lock
Lingo.dev's caching system optimizes your translation workflow by tracking content changes and preventing unnecessary retranslations.
What is the i18n.lock File?
The i18n.lock
file stores checksums of your source content, functioning as Lingo.dev's memory of previously translated content.
Benefits of Content Caching
- Speed: Translates only what has changed, dramatically reducing processing time
- Consistency: Prevents unnecessary retranslations of unchanged content
- Cost Efficiency: Eliminates duplicate translation costs
How Caching Works
- Lingo.dev calculates unique checksums for your source content
- These checksums are compared with those stored in
i18n.lock
- Only content with new or modified checksums gets translated
Intelligent Key Rename Detection
The caching system automatically detects renamed translation keys:
- When you rename a key without changing its content, the system identifies this as a rename operation
- Existing translations are preserved and applied to the new key name
- No retranslation occurs, saving time and resources
This happens automatically, but if both the key name and content change, Lingo.dev will process it as new content requiring translation.
For more details on key renaming, see our Key Renames documentation.
Best Practices
Always commit the i18n.lock file to your repository to maintain translation history
Force retranslation when needed:
bashnpx lingo.dev@latest i18n --force
Use this after changing AI context settings or when you need fresh translations.
Verify translations in CI/CD with the frozen flag:
bashnpx lingo.dev@latest i18n --frozen
This ensures all required translations exist without making changes.
The i18n.lock
file is central to Lingo.dev's "set-it-and-forget-it" approach, ensuring efficient and consistent translations throughout your development process.