Skip to content

Smart Caching with i18n.lock

Lingo.dev's caching system optimizes your translation workflow by tracking content changes and preventing unnecessary retranslations.

What is the i18n.lock File?

The i18n.lock file stores checksums of your source content, functioning as Lingo.dev's memory of previously translated content.

Benefits of Content Caching

  1. Speed: Translates only what has changed, dramatically reducing processing time
  2. Consistency: Prevents unnecessary retranslations of unchanged content
  3. Cost Efficiency: Eliminates duplicate translation costs

How Caching Works

  1. Lingo.dev calculates unique checksums for your source content
  2. These checksums are compared with those stored in i18n.lock
  3. Only content with new or modified checksums gets translated

Intelligent Key Rename Detection

The caching system automatically detects renamed translation keys:

  1. When you rename a key without changing its content, the system identifies this as a rename operation
  2. Existing translations are preserved and applied to the new key name
  3. No retranslation occurs, saving time and resources

This happens automatically, but if both the key name and content change, Lingo.dev will process it as new content requiring translation.

For more details on key renaming, see our Key Renames documentation.

Best Practices

  1. Always commit the i18n.lock file to your repository to maintain translation history

  2. Force retranslation when needed:

    bash
    npx lingo.dev@latest i18n --force

    Use this after changing AI context settings or when you need fresh translations.

  3. Verify translations in CI/CD with the frozen flag:

    bash
    npx lingo.dev@latest i18n --frozen

    This ensures all required translations exist without making changes.

The i18n.lock file is central to Lingo.dev's "set-it-and-forget-it" approach, ensuring efficient and consistent translations throughout your development process.