Skip to content

Fronzen Translations

Replexica's --frozen flag is a powerful tool for maintaining translation integrity, especially in CI/CD pipelines.

Here's what you need to know.

What is Freezing?

When you run npx replexica@latest i18n --frozen, Replexica checks if any translations need updating but doesn't actually update them. If updates are needed, the command fails with a non-zero exit code.

Why Use It?

The main reason is to catch missing translations early. It's particularly useful in CI/CD pipelines where you want to ensure all strings are translated before deploying.

How It Works

  1. Replexica scans your source files;
  2. It compares the current state with the last known state (stored in i18n.lock);
  3. If any differences are found, the command exits with a non-zero status;

This approach prevents half-translated builds from sneaking into production.

CI/CD Integration

Here's a typical use in a CI script:

yaml
- name: Check translations
  run: npx replexica@latest i18n --frozen

If this step fails, it means someone forgot to run translations locally before pushing. Your CI catches this, preventing incomplete localizations from reaching users.

Best Practices

  1. Always run npx replexica@latest i18n locally before pushing changes;
  2. Use --frozen in CI, not in development;
  3. If CI fails due to frozen check, run Replexica locally, commit the changes, then push again.

By using the freeze feature, you're essentially treating missing translations as errors. This might seem strict, but it ensures your app stays fully localized as it evolves.

Remember, the goal isn't to make your life harder. It's to catch localization issues early, when they're cheapest to fix. In the long run, this approach saves time and maintains a better experience for your international users.