How to localize an Android app
Android apps localize with strings.xml resource files: a default in res/values/ and one per language in res/values-<lang>/. You reference strings by ID and Android resolves them per device locale. Here’s the setup, plus how to auto-translate and sync.
i18n in Android
The usual setup uses Android resources (strings.xml). Android stores each language’s strings in res/values-<lang>/strings.xml and resolves R.string.<id> against the device locale at runtime. nlit exports Android XML into exactly that layout, so a pull lands files where Gradle expects them.
<resources>
<string name="greeting">Hello, %1$s!</string>
</resources>val text = getString(R.string.greeting, "Sam")Translate it with nlit
- 1Add your source-language strings to nlit as keys (import your existing files, or start fresh).
- 2Run AI auto-translate into every target language — the credit cost is shown before each run, and your glossary keeps brand terms intact.
- 3Review and approve, then pull the files into your repo with the CLI.
# .nlit.yaml
format: xml
output_dir: app/src/main/res
platform: android
languages:
- de
- fr
- jaapp/src/main/res/
values-de/
strings.xml
values-fr/
strings.xml
values-ja/
strings.xmlFormat for Android: xml. See the CLI docs for every format and flag.
Things to watch for
- Placeholders: nlit rewrites {{name}} to Android %1$s automatically from the platform tag — no manual conversion.
- Plurals: use Android <plurals> with nlit’s plural keys so each language gets the correct quantity strings.
- Escape apostrophes in XML (\') — nlit’s XML export handles this for you on export.
FAQ
How does Android localization work?
You keep a default strings.xml in res/values/ and a translated one in res/values-<lang>/ for each language; Android picks the right one based on the device locale. nlit pulls files straight into that layout.
How do I auto-translate an Android app?
Add your default strings to nlit, run AI auto-translate, review, then pull the XML into app/src/main/res with the CLI.
Does nlit handle Android placeholders and plurals?
Yes. Keys tagged for Android export with %1$s placeholders, and plural keys export as <plurals> with the correct CLDR quantities.
Ship Android in every language
Auto-translate your strings and pull them into your build. Free to start, no card.