Key Renames
Lingo.dev can detect when you rename translation keys without triggering unnecessary retranslations, saving you time and costs.
What are key renames?
Key renames happen when you change the identifier for a translation while keeping the same source content. For example:
json
// Before
{
"welcome_message": "Welcome to our application!"
}
// After
{
"homepage_welcome": "Welcome to our application!"
}
How it works
- Lingo.dev analyzes your source files and their translation keys
- It detects when a key has been renamed but the content remains the same
- Instead of initiating a new translation, it preserves the existing translations and applies them to the new key
Benefits
- Cost efficiency: Avoid paying for retranslations of the same content
- Time savings: Skip waiting for translations you already have
- Consistency: Maintain the same translations across key changes
Key rename detection rules
Lingo.dev will detect a key rename when:
- The key name changes
- The source content remains exactly the same
- The key appears in the same file or location
Lingo.dev will NOT detect a key rename when:
- Both the key name AND the source content change
- In this case, it will treat it as a new translation need
Using with CI/CD
Key rename detection works automatically with the CLI, GitHub Actions, and other CI/CD integrations. No special configuration is needed.
bash
# Standard usage - automatically detects key renames
npx lingo.dev@latest i18n
Pro tips
If you want to force retranslation of renamed keys, use the
--force
flag:bashnpx lingo.dev@latest i18n --force
Key rename detection works seamlessly with Lingo.dev's caching system to provide the most efficient localization workflow possible.