translate-kit

Incremental Translations

How the diff and lock file system works.

translate-kit uses a lock file system to avoid re-translating unchanged content. This makes subsequent runs fast and cheap.

The Lock File

When you run translate-kit translate, a .translate-lock.json file is created in your messages directory. It stores SHA-256 hashes of each source value:

{
  "common.save": "a3f5c8d2e1b4",
  "common.cancel": "7e2b4f9c1a6d",
  "auth.login": "b1c3d5e7f9a2"
}

Diff Computation

On each run, translate-kit computes a diff by comparing:

  • Source locale JSON (current state)
  • Target locale JSON (existing translations)
  • Lock file (previous source hashes)

Keys are classified as:

StatusConditionAction
AddedKey exists in source but not in targetTranslate
ModifiedSource hash differs from lock fileRe-translate
RemovedKey exists in target but not in sourceRemove from target
UnchangedSource hash matches lock fileSkip

Only added and modified keys are sent to the AI model.

Force Re-translation

To ignore the lock file and re-translate everything:

translate-kit translate --force

This is useful when you change the AI model, context, glossary, or tone and want all translations regenerated.

Previewing Changes

Use --dry-run to see what would be translated without making any changes:

translate-kit translate --dry-run

This shows the diff for each locale — how many keys would be added, modified, removed, or skipped.