Translate Android strings.xml without breaking %1$s
A values-de/strings.xml that lost a <b> or uses %2$s twice still builds. Below, one command finds those lines and a missing plural, another translates the file again.
The example project
A small Android strings.xml project: the English source and a German file that fell behind. The commands below ran on exactly these files.
<resources>
<string name="app_name" translatable="false">Tasky</string>
<string name="welcome">Welcome back, %1$s!</string>
<string name="due">Due %1$s at %2$s</string>
<string name="tap_here">Tap <b>here</b> to continue</string>
<plurals name="tasks_left">
<item quantity="one">%d task left</item>
<item quantity="other">%d tasks left</item>
</plurals>
<string name="sign_out">Sign out</string>
</resources>
<resources>
<string name="welcome">Willkommen zurück, %s!</string>
<string name="due">Fällig am %2$s um %2$s</string>
<string name="tap_here">Tippe hier, um fortzufahren</string>
<string name="sign_out">Abmelden</string>
</resources>
1. Find what is missing
kaeris check compares each translation with the source file. It runs offline with no key or account, and exits with code 1 when it finds a problem, so a CI job can stop on it.
$ npx kaeris check --source res/values/strings.xml --langs de
✗ de: 1 missing key(s): tasks_left (plural)
✗ de: 2 placeholder mismatch(es):
welcome: missing ['%1$s'], added ['%s']
due: missing ['%1$s'], added -
✗ de: 6 translation fault(s):
welcome: lost placeholder %1$s
welcome: invented placeholder %s (not in source)
due: lost placeholder %1$s
due: placeholder %2$s appears 2× vs 1× in source (duplicated)
tap_here: lost inline tag </b>
tap_here: lost inline tag <b>
✗ 1 missing key, 2 placeholder mismatches, 6 translation faults
2. Translate the file
--only-new covers JSON and ARB in this release. For strings.xml the CLI says so and translates the whole file again, which also replaces the broken lines. The command is in the Python package: pip install kaeris.
$ kaeris translate res/values/strings.xml --langs de --only-new
→ no key: free demo limits 10,000 chars per file, 8 languages per run, get a key: kaeris.dev/developer
! --only-new supports JSON/ARB only (zero-dependency CLI); translating the whole .xml file instead
→ Translating strings.xml → de
✓ Wrote 1 file(s) to ./res/values-de
res/values-de/strings.xml
✓ Translation QA: no placeholder loss, no overflow risks
→ Run: openai/gpt-6-luna · Free · 1/1 languages · 6 strings · 5.7s
95 charged
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by KAERIS i18n Tool — de -->
<resources>
<string name="welcome">Willkommen zurück, %1$s!</string>
<string name="due">Fällig am %1$s um %2$s</string>
<string name="tap_here">Tippe <b>hier</b>, um fortzufahren</string>
<plurals name="tasks_left">
<item quantity="one">%d Aufgabe übrig</item>
<item quantity="other">%d Aufgaben übrig</item>
</plurals>
<string name="sign_out">Abmelden</string>
</resources>
3. Check again
Exit code 0: every key is there and every placeholder matches the source.
$ npx kaeris check --source res/values/strings.xml --langs de ✓ de: complete & placeholder-safe ✓ all locales complete & placeholder-safe
Run on 2 November 2026 on the free tier, without a key: npx kaeris 0.2.42 for the check, kaeris 0.2.42 from PyPI for the translation. Output as printed, except that progress lines and the local folder path are left out.
What kaeris check catches in Android strings.xml
Missing strings and plurals
<plurals name="tasks_left">missing fromvalues-deis reported. Strings markedtranslatable="false"are not required.Positional specifiers
%sin place of%1$s, and%2$sused twice, are both reported.Inline markup
<b>dropped from a string is reported.
What it costs
kaeris checkis freeIt runs on your machine: no key, no account, no limit.
Translation is free to start
Without a key: 10,000 characters per file, 300,000 a day, up to 8 languages per run. A free key raises this to 50,000 characters per file and 1.5M a month. Volume counts characters once per target language.
Beyond the free tier
Lifetime is $79 once and runs on your own OpenRouter key, so the model is paid separately. Pro is $19 a month or $190 a year for 12M characters a month. Pricing
Questions
What happens to translatable="false"?
Those strings stay out: the check does not ask for them and the translation does not include them, as with app_name above.
Is the XML safe to parse?
Yes. Files with a DOCTYPE or external entities are refused before parsing.
Can it run in CI?
Yes. npx kaeris check exits with code 1 when it finds a problem. Recipes: GitHub Actions, GitLab CI, pre-commit.
Keep going
Check reference · CLI reference · Free check in the browser · Translate in the browser
Other stacks: react-i18next · next-intl · vue-i18n · Flutter · iOS