kaeris_translate_file
Translate app strings files into multiple languages, writing translated versions to the same folder. Supports eleven formats, incremental updates, and automatic back-translation checks.
Instructions
Translate a strings file on disk and write the results next to it.
Supports JSON, YAML, .strings, .po, ARB, Android XML, CSV, XLIFF 1.2, Java/Spring .properties, .NET RESX and Mozilla Fluent (.ftl). With only_new=True (JSON), translates just the keys missing from existing target files and merges.
Args: file_path: path to the source file, e.g. "locales/en.json". target_languages: language codes, e.g. ["de", "uk", "zh"]. out_dir: where to write outputs (default: the source file's directory). only_new: reproducible incremental mode — translate only new AND edited keys, tracked via kaeris.lock (a tone/ICU/glossary change re-translates all); unchanged stays stable. JSON only. keep: optional list of terms to NEVER translate — kept verbatim in every language (brand/product names), e.g. ["KAERIS", "GitHub"]. context: one line about what the app IS, e.g. "a mobile bank for teenagers" or "a wildlife documentary app". The model uses it to pick the right sense of ambiguous strings — "Bank" becomes Ufer in the second and Bank in the first. You are reading the repo, so you know this: pass it. Max 300 chars. verify: back-translate each result into back_lang to confirm meaning (non-incremental only). back_lang: language for the verify back-translation (default "en"). tone: "formal" or "casual" to steer register; "" (default) is neutral. icu: True if values may contain ICU MessageFormat (plurals/select) so the model preserves the syntax instead of translating it. reuse: optional {lang: {key: previous_translation}} translation-memory map — strings unchanged from a prior run are reused verbatim server-side (non-incremental only; only_new does its own client-side diffing). api_key / openrouter_key: optional auth overrides.
Returns: { "written": ["locales/de.json", ...], "languages": [...] }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| icu | No | ||
| keep | No | ||
| tone | No | ||
| reuse | No | ||
| verify | No | ||
| api_key | No | ||
| context | No | ||
| out_dir | No | ||
| only_new | No | ||
| back_lang | No | en | |
| file_path | Yes | ||
| openrouter_key | No | ||
| target_languages | Yes |