kaeris_translate
Translate UI strings into multiple languages with placeholder-safe output, QA warnings for dropped tokens or overflow, and optional back-translation verification.
Instructions
Translate a set of UI strings into one or more languages.
Format-aware and placeholder-safe: values like "Hello, {name}" keep their placeholders intact. Non-string values are passed through unchanged.
Includes Translation QA so you can trust the output: it flags translations that dropped a placeholder or that grew long enough to risk overflowing the UI. With verify=True it also back-translates each result into back_lang so you can check the meaning is right even in a language you can't read.
Args: strings: key → source-text pairs, e.g. {"greeting": "Hello", "save": "Save"}. target_languages: language codes from kaeris_list_languages, e.g. ["es", "fr", "ja"]. 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 (uses more tokens). 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 that are unchanged from a prior run are reused verbatim server-side and only new/changed strings are actually translated. api_key: optional KAERIS key (else uses the free tier or KAERIS_API_KEY env). openrouter_key: optional OpenRouter key for Lifetime/BYOK.
Returns: { "translations": { "": { "": "", ... }, ... }, "placeholder_warnings": { "": { "": ["{name}", ...] } }, # if any placeholders were lost "overflow_warnings": { "": [ {"key","src","tr","pct"}, ... ] }, # if UI-overflow risk "back_translations": { "": { "": "" } }, # only if verify=True "failed_languages": [...] # present only if some languages could not be translated }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| icu | No | ||
| keep | No | ||
| tone | No | ||
| reuse | No | ||
| verify | No | ||
| api_key | No | ||
| context | No | ||
| strings | Yes | ||
| back_lang | No | en | |
| openrouter_key | No | ||
| target_languages | Yes |