Configuration
Lokalio supports two translation modes that control which keys get sent for translation.
Mode Comparison
| Diff Mode | Add/Remove Mode | |
|---|---|---|
| Behavior | Translates only keys changed in the current git push range | Scans source files and translates any key present in source but missing from target files |
| Best for | Ongoing development — minimizes cost and noise | Bootstrapping new languages or projects |
| Default | Yes | No |
| CI detection | Auto-detects git range from push event | Fallback when no git range available |
| Cost | Proportional to changed keys | Proportional 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/mainAdd/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