Cherry-picking Translation Updates
Sometimes you don't want to translate everything. Maybe you've tweaked your AI context for a specific section, or you're focusing on a particular language.
Replexica's CLI gives you the tools to be surgical about your updates.
Why Cherry-pick?
Updating all translations isn't always the best move. Here's why:
- Performance: Updating everything takes time. If you're in a hurry, focus on what matters;
- Precision: Sometimes you want to fine-tune specific areas without touching others;
- Testing: When experimenting with AI context changes, you might want to see the effect on a limited scope first.
The Tools
Replexica gives you three main flags for cherry-picking:
--force
: Ignore the lockfile and retranslate everything in scope;--bucket
: Focus on a specific bucket;--locale
: Target a specific language.
Let's dive into how these work.
--force
: The Sledgehammer
When you use --force
, you're telling Replexica, "I don't care what's in the lockfile, translate everything again." It's powerful, but use it wisely.
npx replexica@latest i18n --force
This command will retranslate every string in every bucket for every target language. It's useful when:
- You've significantly changed your AI context settings;
- You suspect the lockfile might be corrupted;
- You want a fresh start.
But remember, with great power comes great responsibility (and potentially long processing times). Also be mindful of your API usage.
--bucket
: The Scalpel
The --bucket
flag lets you focus on a specific section of your translations. It's like telling Replexica, "Just worry about this part."
npx replexica@latest i18n --bucket json
This is handy when:
- You've updated content in a specific area of your app;
- You're testing changes to AI context for a particular section;
- Different parts of your app have different update frequencies.
--locale
: The Language Filter
With --locale
, you're saying, "I only care about this language right now."
npx replexica@latest i18n --locale fr
This is useful when:
- You're launching in a new market and need to focus on that language;
- You're reviewing translations for a specific language;
- Different languages have different update priorities.
Combining Powers
The real magic happens when you combine these flags. For example:
npx replexica@latest i18n --force --bucket json --locale de
This command says, "Retranslate everything in the 'app' bucket, but only for German." It's like a laser-focused translation update.
The Rationale
Why did we build Replexica this way? Because real-world localization is messy. Sometimes you need broad strokes, sometimes you need precision. By giving you these tools, we're letting you adapt to your specific needs.
The --force
flag exists because sometimes you need a clean slate. The --bucket
flag acknowledges that not all parts of your app are created equal. And --locale
recognizes that language priorities can vary.
Pro Tips
- Use
--force
sparingly. It's powerful but can be time-consuming. - Combine
--bucket
with your CI/CD pipeline to automatically update translations for changed areas. - Use
--locale
when entering new markets to focus your efforts. - Always commit your lockfile after cherry-picking to keep your team in sync.
By mastering these flags, you're not just using Replexica – you're wielding it with precision.