Skip to content

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:

  1. Performance: Updating everything takes time. If you're in a hurry, focus on what matters;
  2. Precision: Sometimes you want to fine-tune specific areas without touching others;
  3. 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.

bash
npx replexica@latest i18n --force

This command will retranslate every string in every bucket for every target language. It's useful when:

  1. You've significantly changed your AI context settings;
  2. You suspect the lockfile might be corrupted;
  3. 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."

bash
npx replexica@latest i18n --bucket json

This is handy when:

  1. You've updated content in a specific area of your app;
  2. You're testing changes to AI context for a particular section;
  3. 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."

bash
npx replexica@latest i18n --locale fr

This is useful when:

  1. You're launching in a new market and need to focus on that language;
  2. You're reviewing translations for a specific language;
  3. Different languages have different update priorities.

Combining Powers

The real magic happens when you combine these flags. For example:

bash
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

  1. Use --force sparingly. It's powerful but can be time-consuming.
  2. Combine --bucket with your CI/CD pipeline to automatically update translations for changed areas.
  3. Use --locale when entering new markets to focus your efforts.
  4. 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.