Android localization guide

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.

res/values/strings.xmlxml
<resources>
  <string name="greeting">Hello, %1$s!</string>
</resources>
MainActivity.ktkotlin
val text = getString(R.string.greeting, "Sam")

Translate it with nlit

  1. 1Add your source-language strings to nlit as keys (import your existing files, or start fresh).
  2. 2Run AI auto-translate into every target language — the credit cost is shown before each run, and your glossary keeps brand terms intact.
  3. 3Review and approve, then pull the files into your repo with the CLI.
.nlit.yamlyaml
# .nlit.yaml
format: xml
output_dir: app/src/main/res
platform: android
languages:
  - de
  - fr
  - ja
nlit pull → writessh
app/src/main/res/
  values-de/
    strings.xml
  values-fr/
    strings.xml
  values-ja/
    strings.xml

Format 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.