Skip to content

Caching: The i18n.lock File

Replexica uses a lockfile (i18n.lock) to optimize translation updates. Here's why it matters and how it works.

What's the i18n.lock file?

It's file that stores checksums of your source content. Think of it as Replexica's memory of what it's seen before.

Why use a lockfile?

  1. Speed: Replexica only translates what's changed;
  2. Consistency: Prevents unnecessary retranslations of unchanged content;
  3. Cost-efficiency: You're not billed for translating the same thing twice.

How it works

  1. Replexica calculates checksums for your source content;
  2. It compares these with the stored checksums in i18n.lock;
  3. Only content with new or changed checksums gets translated.

Pro tips

  1. Always commit i18n.lock. It's crucial for tracking changes.

  2. Use --force to ignore the lockfile and retranslate everything:

    bash
    npx replexica@latest i18n --force

    Useful after changing AI context settings.

  3. The --frozen flag is great for CI/CD to catch missing translations:

    bash
    npx replexica@latest i18n --frozen

Remember, Replexica's goal is to make localization a set-it-and-forget-it process. The lockfile is a key part of that, ensuring you're always efficient with your translations.