Configuration

Lokalio supports two translation modes that control which keys get sent for translation.

Mode Comparison

Diff ModeAdd/Remove Mode
BehaviorTranslates only keys changed in the current git push rangeScans source files and translates any key present in source but missing from target files
Best forOngoing development — minimizes cost and noiseBootstrapping new languages or projects
DefaultYesNo
CI detectionAuto-detects git range from push eventFallback when no git range available
CostProportional to changed keysProportional to missing keys

Diff Mode (Default)

Diff mode uses git diff against the base branch to detect changed keys. Only added or modified translation strings are sent to the AI.

How it works

On push, CI provides the commit range (before..HEAD). Lokalio runs git diff to find changed files. Only keys that were added or modified are translated. The translation branch receives one commit per run.

Override the diff base:

npx lokalio generate --base origin/main

Add/Remove Mode

Add/remove mode scans source files and translates any key that exists in the source but is missing from the target file.

When to use:

  • Adding a new target language to an existing project
  • Bootstrapping translations for a new project
  • Catching up after adding many new source keys

Already-translated keys are never retranslated — only missing ones are filled in.

Mode Override

Override the mode from .lokalio.yaml with the --mode flag:

npx lokalio generate --mode add-remove