Translation Overriding
Replexica's AI-powered translations are designed to be accurate and context-aware.
However, there might be rare cases where you need to manually override certain translations. This guide explains how to handle translation overrides effectively.
How Translation Overrides Work
When you edit translations in your non-source locale files, Replexica preserves these changes. This feature allows you to fine-tune translations without worrying about losing your edits during subsequent AI translation runs.
Here's the key point: Your manual edits are preserved unless the corresponding entry in the source locale file changes.
Why this approach? It strikes a balance between maintaining your custom translations and ensuring your localized content stays up-to-date with source changes.
Implementing Translation Overrides
- Open your non-source locale file (e.g.,
es.json
for Spanish, given your source locale is set toen
ini18n.json
config file); - Locate the key-value pair you want to override;
- Edit the value to your desired translation;
- Save the file.
That's it. Replexica will respect this change in future runs.
Example:
// Before (es.json)
{
"welcome_message": "Bienvenido a nuestra aplicación"
}
// After manual edit (es.json)
{
"welcome_message": "¡Hola! Bienvenido a nuestra fantástica aplicación"
}
This change will persist across Replexica runs, as long as the source (en.json
in this case) for welcome_message
remains unchanged.
When Overrides Get Overwritten
Your manual overrides will be replaced by new AI translations in two scenarios:
- The source text for that key changes.
- You use the
--force
flag with thei18n
command.
Why?
Changes in the source often necessitate retranslation to maintain accuracy and context.
The --force
flag is specifically designed to retranslate everything, useful when you've updated your AI context settings.
This system allows you to harness the speed and scalability of AI translations while maintaining the ability to add human touches in rare cases.