Documentation reviewed 23 November 2026.
Quick answer
Android localization means keeping every user-facing string in res/values/strings.xml, adding one values-<language> folder per language, and letting the system pick the folder that matches the user's locale. Use <plurals> for anything with a count, positional format arguments such as %1$s for anything with a variable, and the platform formatters for dates, numbers and currency. Turn on per-app language support with generateLocaleConfig, set android:supportsRtl="true", and test with the en-XA and ar-XB pseudolocales before any translation arrives. Run Android lint in CI so MissingTranslation and ExtraTranslation stop a build with incomplete files. If a model translates the files, check format arguments, escaping and plural quantities before you merge.
Who this is for
This guide is for developers who own an Android app written in Kotlin, with Jetpack Compose or Views, and need it to work in more than one language. The samples target Android Gradle plugin 8.8 or later (9.5.0 is current), the Compose BOM 2026.09.00, and AppCompat 1.6.0 or later.
At the end you will have:
- Every string in resource files, with plurals and placeholders that survive translation.
- Locale folders named so Android's fallback rules work for you.
- A language entry for your app in the Android 13 system settings.
- A layout that survives long text and right to left scripts.
- A CI job that fails on a missing, extra or malformed translation.
- A Google Play listing that fits the field limits in every language.
If you also ship on iOS or Flutter, how to localize a mobile app into 20 languages covers the cross-platform plan.
Part 1: strings.xml and the values folders
The default file
Android reads strings from XML files in res/values/. The file name is arbitrary. strings.xml is the convention, and a string is identified by its name attribute, not by the file it sits in.
The comment above a string is the only context a translator or a model gets. Say what the string is for, where it appears and how much room it has.
Translations go in sibling folders with a locale qualifier:
The default file must contain every string the app uses. A localized file may hold a subset. If a string exists only in values-fr, the app runs on a French device and shows an error with a Force Close button on every other device.Naming the folders
There are two spellings for a locale qualifier, and both are valid.
| Form | Example | Use it when |
|---|---|---|
| Language only | values-fr | One translation serves every region. This is the usual case. |
| Language and region | values-pt-rBR, values-en-rGB | A region needs its own text. The region code takes a lowercase r prefix. |
| BCP 47 tag | values-b+es+419, values-b+zh+Hant, values-b+sr+Latn+RS | You need a script subtag or a numeric region. Supported since Android 7.0 (API level 24). |
A regional file holds only the strings that differ. Everything else falls back.
How Android picks a locale
From Android 7.0 (API level 24) users can list several languages in order. Android's own example: the user's language is fr_CH, and the app ships a default (English) plus de_DE, es_ES, fr_FR and it_IT.
| Step | Before Android 7.0 | Android 7.0 and later |
|---|---|---|
| 1 | Try fr_CH, fail | Try fr_CH, fail |
| 2 | Try fr, fail | Try fr, fail |
| 3 | Use the default (English) | Try children of fr, find fr_FR |
| Result | English | French |
If the first language finds nothing, Android repeats the steps for the user's second language before it uses the default.
Two practical rules follow from the documentation:
- Store text in the parent language. Put French in
values-fr, notvalues-fr-rFR. Android recommends the most common parent dialect:values-b+es+419for Latin American Spanish instead ofvalues-es-rUS, andvalues-b+en+001for international English instead ofvalues-en-rGB. - Locale almost always wins, but not always. Among resource qualifiers, only mobile country code and mobile network code (
values-mcc404) take precedence over language. Avoid MCC folders for text.

Keep library languages out of the build
Libraries such as AppCompat ship their own translations, so without a filter your APK contains languages your app does not support. Android's resolution guide says to declare the supported languages in the build. The Android Gradle plugin does this with localeFilters, added in AGP 8.8.0:
Several Android guide pages still showresConfigsorresourceConfigurationsfor this. The plugin's DSL reference marksresourceConfigurationsas deprecated in 8.8.0 and points toandroidResources.localeFilters.
Part 2: reading strings in code
In Compose, stringResource() reads a string and accepts format arguments directly. Outside a composable, use context.getString() with the same arguments.
Format arguments
Write arguments with a position: %1$s for the first argument as a string, %2$d for the second as an integer. A translation can then reorder them. German might need the count first, and %2$d still refers to the same value wherever it lands in the sentence. Two bare %s cannot be reordered.
To tell a translator which parts must not change, wrap them in an <xliff:g> placeholder tag. The id explains what the value is, and example shows a realistic one.
Strings that are not translated
Mark a string that must stay the same in every language with translatable="false". Lint then stops asking for it in other locales. The lint documentation lists two more options: put such strings in a file named donottranslate.xml, or silence one string with tools:ignore="MissingTranslation".
If your default language is not English, add tools:locale="es" (or your language) to the root <resources> element so lint and the editor know what the default file contains.
String arrays
A <string-array> holds an ordered list. Read it with stringArrayResource() in Compose or resources.getStringArray() elsewhere.
Arrays are translated by position, so every language must keep the same items in the same order. An item can also be a reference to another string resource (<item>@string/planet_mercury</item>), which gives each entry a name of its own.
Part 3: escaping rules
Most broken Android translations are escaping errors. The rules come in two layers: XML first, then Android.
| Character | Write it as |
|---|---|
' apostrophe | \', or wrap the whole string in double quotes |
" double quote | \" (wrapping in single quotes does not work) |
@ | \@ |
? | \? |
| New line | \n |
| Tab | \t |
| Unicode character | \uXXXX |
< and & as text | < and & (standard XML escaping) |
Android also collapses runs of whitespace into one space. To keep them, enclose that part of the string in double quotes. Whitespace collapsing and Android escaping happen after the file is parsed as XML, so an XML entity for a space collapses like any other space.
Markup inside a string
A string resource can carry HTML-style tags. Android's string documentation lists the supported set, which includes <b>, <i>, <u>, <s>, <sup>, <sub>, <br>, <ul> with <li>, <font>, <span> and <p>.
Formatting methods such as stringResource() strip that styling. When a string needs both a format argument and styling, the documented approach is to store the tags escaped and convert after formatting:
A CDATA section is the other way to keep tags as text. It is a feature of XML, not of Android: everything between <![CDATA[ and ]]> reaches Android as literal characters, the same result as writing <. Android's own escaping runs after XML parsing, so an apostrophe inside CDATA still needs a backslash.
For styled text that also needs translating, Android recommends an <annotation> tag in each locale's file, because the translator can move the annotation to wherever the emphasized words land in their sentence.
Part 4: plurals
English has two plural forms. Many languages have more, and some have one. Android's <plurals> resource holds one string per quantity category: zero, one, two, few, many and other.
The count appears twice on purpose. The first selects the plural form. The second fills %d.
Which categories each language uses
The category names are grammatical, not numeric. Selection follows the Unicode CLDR plural rules, and a category your language does not use is never returned. Android's documentation gives the example: in English a zero string is ignored even when the quantity is 0, because English grammar treats 0 like 2.
| Language | Cardinal categories (CLDR) |
|---|---|
| Japanese, Chinese, Korean, Thai, Indonesian | other |
| English, German, Dutch, Swedish, Turkish | one, other |
| French, Spanish, Italian, Portuguese | one, many, other |
| Hebrew | one, two, other |
| Romanian | one, few, other |
| Russian, Ukrainian, Polish, Czech, Lithuanian | one, few, many, other |
| Slovenian | one, two, few, other |
| Arabic, Welsh | zero, one, two, few, many, other |
A Polish file therefore has four items where the English one has two:

Always put%din theonestring. In Russian,onecovers 1, 21, 31 and every number ending in 1 except those ending in 11. A string that says "One song" without the number is wrong for 21.
Three more rules from the Android documentation:
- Use plurals only for grammar. Do not use
zeroto show "No messages". Chinese and Korean only ever returnother, so the special case never appears. Use anifin code and a separate string. - A message without the number is a poor fit for plurals. "A book" and "many books" cannot be selected correctly in a language where 101 takes the singular form.
- Quantity-neutral wording avoids the problem. "Songs: 3" needs no plural at all.
Plurals or ICU MessageFormat
| Approach | Fits |
|---|---|
<plurals> with pluralStringResource() | Almost every count in an Android app. Lint understands it and every translation tool reads it. |
ICU MessageFormat in android.icu.text (API level 24 and later) | Messages with two counts, or a plural combined with a select, where one string must carry several choices. |
| Quantity-neutral text | Labels and tables where "Items: 3" reads naturally. |
Part 5: per-app language preferences
Android 13 (API level 33) added a system setting where a user picks a language for one app without changing the phone's language. Users reach it under Settings, System, Languages and Input, App Languages, or from the app's own page in Settings. Your app appears there only if it declares its languages.
The automatic way
From Android Studio Giraffe and AGP 8.1 the build can generate the declaration from your values-* folders. This needs compileSdk 33 or higher.
The second file is res/resources.properties in the app module. It names the language of the default res/values folder. Nothing appears in your manifest or under res/xml: both are generated at build time.
WithgenerateLocaleConfigon, the build fails if a hand-written LocaleConfig file also exists. Delete the manuallocale_config.xmlfirst. The generated list also includes locales that come from library modules, so make sure each of those is ready to ship.
The manual way
If you need a list that differs from your folders, write it yourself and point the manifest at it:
Locale names here use dashes (zh-Hans-MO), not the folder spelling. Include the default language of res/values.
generateLocaleConfig | Manual locale_config.xml | |
|---|---|---|
Stays in sync with new values-* folders | Yes | No, you edit it |
| Lets you hide a language that is not ready | No | Yes |
| Build requirement | AGP 8.1 or later, compileSdk 33 or later | None beyond the manifest attribute |
An in-app language picker
For a picker inside the app, use the AndroidX API. It keeps the system setting and your picker in sync and works on older versions too.
Two conditions apply. The activity that hosts your Compose UI must extend AppCompatActivity, or setting the locale does nothing. And for Android 12 (API level 32) and lower, AndroidX only remembers the choice if you opt in to autoStoreLocales:
Part 6: right to left
Arabic, Hebrew, Persian and Urdu are written right to left. Supporting them takes three steps.
- Declare support. Add
android:supportsRtl="true"to the<application>element. - Replace left and right with start and end.
paddingLeftbecomespaddingStart,layout_marginRightbecomeslayout_marginEnd,gravity="left"becomesgravity="start". In Compose, padding values are already defined as start and end, and resolve to left or right from the layout direction. - Mirror directional images. A back arrow must point the other way. For a vector drawable, set
android:autoMirrored="true". In Compose, use theIcons.AutoMirroredset, for exampleIcons.AutoMirrored.Outlined.ArrowForward. Leave images without direction, such as a clock or a logo, alone.
Where a whole layout must differ, the -ldrtl qualifier (res/layout-ldrtl/) provides a right to left version. Language-specific resources take precedence over it.
Mixed-direction text
Inserting a Latin-script address or a phone number into an Arabic or Hebrew sentence can put digits and punctuation in the wrong place. Wrap inserted text with BidiFormatter:
To check the layout without knowing an RTL language, turn on Force RTL layout direction in the device's developer options, or use the ar-XB pseudolocale described in Part 8.
Part 7: dates, numbers and currency
Never put a date or number format in strings.xml, and never build one by hand. Android's guidance has been explicit since Android 7.0 widened the set of locales: Arabic alone has 27 supported locales, some of which prefer ASCII digits and some native digits.
Set the currency yourself. The locale decides how a price looks, not which currency the user is charged in.
The reverse case matters as well. When a number goes to a machine, such as a SQL query or an API, format it with String.format(Locale.US, ...). On a device set to Persian or most Arabic locales, default formatting writes the locale's own digits, and those are not valid in SQL.
Part 8: long text, pseudolocales and testing
Design for longer text
Translated text is often longer than the English it replaces. Let labels wrap, let buttons grow, and avoid fixed widths.
Pseudolocales
A pseudolocale is a fake language the build generates from your default strings. Android provides two:
| Pseudolocale | Tag | What it does | What it reveals |
|---|---|---|---|
| English (XA) | en-XA | Adds accents, makes text longer, wraps each message in brackets | Clipped text, hardcoded strings (they stay unaccented), concatenated sentences (they show as several bracketed pieces) |
| AR (XB) | ar-XB | Reverses the text direction | Layouts that do not mirror, misplaced punctuation |
Enable them for debug builds only:
Then, with developer options enabled on the device, open Settings, Languages and input, Language preferences, and drag the pseudolocale to the top of the list. If the pseudolocales are missing from the APK, check that your locale filter is not removing them.
Runen-XAandar-XBonce before you send anything for translation. Every problem they show is cheaper to fix now than after 20 languages have been translated around it.
Other ways to test a locale
- Compose previews.
@Preview(locale = "fr")renders a composable in French inside Android Studio, and@Preview(locale = "ar")shows it right to left. - Emulator from adb. In an
adb shell, runsetprop persist.sys.locale fr-CA;stop;sleep 5;startand relaunch the app. - An unsupported language. Set the device to a language you have not translated and run the app. If it shows an error and a Force Close button, a string is missing from the default file.
Part 9: the AI translation step
When a model translates strings.xml, the sentences are rarely the problem. The file format is. AI translation against human translation covers when a person should still read the result. This part covers the mechanical failures, which you can catch without a reviewer.
What breaks
| Failure | Example | Result |
|---|---|---|
| Format argument changed | %2$d returned as %2$s, % 1$s, or dropped | Wrong value, or an exception at runtime when the string is formatted |
| Position lost | %1$s and %2$s returned as two %s | Arguments print in the wrong order after reordering |
| Apostrophe not escaped | l'invitation in French, where the English had none | Breaks Android's escaping rule. French, Italian and Catalan add apostrophes that the English never had |
Unescaped @ or ? | A translation that starts with ? | Both characters have a special meaning in Android and need a backslash |
| Plural categories copied from English | Polish returned with only one and other | Missing forms for 2 to 4 and for 5 and up |
| Plural categories invented | zero added to an English or German file | Never shown, since the language does not use it |
%d removed from one | "Одна песня" for the Russian one | Wrong for 21, 31, 101 |
| Markup altered | <b> translated, moved outside its words, or <b> unescaped to <b> | Styling lost, or a format string that no longer formats |
<xliff:g> content translated | The example product name translated | A value that was marked as fixed has changed |
| Array length changed | Two items merged into one | Every later item is shifted by one |
| Key invented or renamed | A name that does not exist in the default file | ExtraTranslation fails the release build |

How to check it
Android lint already knows most of these. The relevant issue ids, all part of the built-in checks:
| Lint id | Default severity | Catches |
|---|---|---|
MissingTranslation | Error | A string in the default file with no translation in a locale |
ExtraTranslation | Fatal | A translated string with no default. Also enforced in release builds |
StringFormatInvalid | Error | A format string that would throw at runtime |
StringFormatMatches | Error | The same numbered argument with different types across translations |
StringFormatCount | Warning | A different number of arguments across translations |
MissingQuantity | Error | A plural missing a category its language needs |
UnusedQuantity | Warning | A plural with a category its language never uses |
ImpliedQuantity | Error | A plural form without a number where the language needs one |
Raise the two warnings that signal a bad translation to errors, and keep abortOnError on:
Lint needs a Gradle project and a few minutes. A short script gives a faster second check that runs on the files alone, straight after the translation step. This one compares the format arguments of every translated string and plural item with the default file, flags unescaped apostrophes, and exits with 1 on a problem:
Run against a sample with a changed argument type, a missing %d in a plural and an unescaped apostrophe, it reported all three. It covers the common conversions (s, d, f, x, c) and is a starting point, not a full parser. Automated localization QA describes the wider set of checks.
Ways to get the translation
| Approach | How it works | Fits |
|---|---|---|
| Translate by hand in the Translations Editor | Android Studio shows every key and language in one grid | One or two languages, a small app |
| Gemini in Android Studio | Translates string resources inside the project | A quick first draft with the developer reviewing |
| Play Console | Order paid human translation of app strings and listing text from a vendor, or opt in to automatic translation of app strings | Teams that want a vendor without choosing one |
| A script and a model API | Your code sends changed strings and writes the files | Many languages, engineers who will own the checks above |
| A localization platform | A service reads strings.xml, translates, checks and gives reviewers an editor | Many languages, non-developer reviewers, frequent releases |
Platforms that read Android XML include Lokalise, Crowdin, Phrase, Localazy and Transglot. The Crowdin, Lokalise and Localazy comparisons price one workload on each. None was tested for this guide.
Part 10: the Google Play listing
The store listing is localized separately from the app, in Play Console under Grow users, Store presence, Store listings. Each language gets its own text and its own graphics.
| Field | Character limit |
|---|---|
| App name | 30 |
| Short description | 80 |
| Full description | 4,000 |
The limits apply equally to full-width and half-width characters. Write the short fields for each language instead of translating them word for word, and count before you submit.
Three details from the Play Console help that are easy to miss:
- Play's language codes are not Android's. The listing uses
es-419for Latin American Spanish,iw-ILfor Hebrew, andzh-CNandzh-TWfor Chinese. Map them to yourvalues-*folders once and keep the mapping in the repository. - Untranslated listings are machine translated for the user. Google Play offers an automated translation, with a notice, when you have no listing in the user's language.
- Play Console has its own translation services. A paid human service covers the listing and in-app products, and a free machine translation service covers a short list of languages.
Keep feature names the same in the listing and the app. Glossary and terminology at scale explains how to hold terms steady across languages.
Part 11: keeping it current in CI
A localized app goes stale on the first release that adds an English string. Android's lint documentation notes that lint does not run as part of a normal build and recommends running it explicitly in continuous integration. Three commands cover the localization gates:
If the project already has lint findings, add baseline = file("lint-baseline.xml") to the lint block. The first run records current issues, and later runs report only new ones.
Translate only the strings that changed, run the checks on the result, and have a person review the screens that matter most. Keeping the files in the repository under the same review as code is the approach described in localization as code.
Doing this with Transglot
Transglot is a continuous localization platform that reads and writes Android XML (format id android_xml). From the repository root:
init finds the resource files, works out the source language, signs you in through the browser, runs the first translation and writes a transglot.json with the source and pull paths. After that, transglot push --wait uploads changed strings and transglot pull writes the translated files. The tool needs Node.js 22 or later. The configuration file reference explains each field.
Four checks run on every string before it is written: placeholders, plural forms, glossary terms and length. For Android, %1$s and %d must come back unchanged and a plural must have the categories its language uses. A string that fails placeholders, plurals or the glossary is retried once, and if it still fails it is refused instead of written. See quality checks and plural forms. On export, Android's escaping is applied to apostrophes, quotes, &, <, and a leading @ or ?.
To run it on every push, the GitHub Action uploads new strings, waits, pulls the files and commits them:
There is a connector for the Google Play store listing as well.
Limits to know before you start
These come from Transglot's own Android XML format page:
<string-array>is skipped with a warning. Use@string/references for the items, and keep the array in a file Transglot does not write.- Inline markup is not kept. A
<string>is read as its text, so<b>,<i>and<xliff:g>tags are dropped on import, and markup in a translation is written back escaped. - Comments are not written on export. Keep translator context in the default file or in the CLI's metadata sidecar.
translatable="false"strings are not imported, translated or counted.- A category the language does not use is an import error. A
zeroitem in an English file must be removed first. - No over-the-air updates for native Android. The runtime SDKs are JavaScript only. Android apps use the file round trip and ship strings in the build.
- Not self-hostable, and the CLI is paid. The CLI, the GitHub Action and the API start on the Starter plan at $19 a month for 300,000 translated words. The Free plan works through the browser console only. See pricing.
Common mistakes
- A string that exists only in a
values-xxfolder. The app crashes in every other language. - Storing French in
values-fr-rFR. A Canadian or Swiss user may not get it on older Android versions. - Concatenating sentences in code. Word order differs between languages. Use one string with
%1$s. - Bare
%stwice in one string. Translations cannot reorder them. - Using
quantity="zero"for an empty state. It is ignored in English and in most languages. - Leaving the number out of the
onestring. Wrong for 21 in Russian. - Passing the count once to
pluralStringResource(). The form is chosen but%dhas no value. paddingLeftandlayout_marginRightin a layout. They do not mirror.- A date pattern in
strings.xml. UseDateTimeFormatter.ofLocalizedDate(). - Enabling
generateLocaleConfigwithout reading the generated list. It is built from library modules too. setApplicationLocalesin an activity that does not extendAppCompatActivity. Nothing happens.- Trusting a translated file because it parses. Valid XML can still have a missing
%dor a missing plural form.
Checklist
Frequently asked questions
Where do translations go in an Android project?
Default strings go in res/values/strings.xml. Each translation goes in a folder named with a locale qualifier, such as res/values-fr/strings.xml or res/values-pt-rBR/strings.xml. Android chooses the folder at runtime from the user's language list and falls back to the default file for anything missing.
What is the difference between values-es-rMX and values-b+es+419?
Both are valid. The first is the language plus region form, with an r before the region code. The second is a BCP 47 tag, available from Android 7.0, which also allows script subtags and numeric regions such as 419 for Latin America. Android recommends the most common parent, so one values-b+es+419 file serves the region.
How do Android plurals work?
A <plurals> resource holds one string per quantity category: zero, one, two, few, many, other. pluralStringResource() or getQuantityString() picks the category from the number using the language's grammar rules. English uses one and other, Polish uses four categories, Arabic uses six, and Japanese uses only other.
How do I escape an apostrophe in strings.xml?
Write \', or wrap the whole string in double quotes. A double quote is written \". The characters @ and ? have a special meaning in Android and are written \@ and \?.
How do I add a language setting for my app on Android 13?
Set generateLocaleConfig = true in the androidResources block and add res/resources.properties with unqualifiedResLocale set to your default language. The build then lists your languages in the system's per-app language settings. For an in-app picker, call AppCompatDelegate.setApplicationLocales() from AppCompat 1.6.0 or later.
How do I test an Android app in another language without a translation?
Enable pseudolocales on the debug build with isPseudoLocalesEnabled = true, then select English (XA) or AR (XB) in the device's language settings. The first shows expanded, accented text and the second shows right to left layout. Compose previews accept a locale too, as in @Preview(locale = "ar").
Why does my build fail with MissingTranslation or ExtraTranslation?
MissingTranslation means a string in the default file has no translation in one of your locales. Translate it, or mark it translatable="false". ExtraTranslation means a translated string has no default, which can crash the app in other locales. Remove it or add the default.
Can I use AI to translate strings.xml?
Yes. Check four things before merging: format arguments match the source, apostrophes and quotes are escaped, each plural has the categories its language needs, and inline markup is intact. Lint catches most of these.
How this guide was checked
- Resource folders, locale resolution, string syntax, escaping, plurals, per-app language, right to left, pseudolocales and testing follow the developer.android.com pages under Sources.
- The Gradle settings follow the Android Gradle plugin DSL reference. Where a guide page and the reference disagree (
resourceConfigurations), this guide follows the reference. - Plural categories per language follow the Unicode CLDR plural rules chart. The CLDR version on a device depends on its Android version, so very old devices can differ.
- Lint issue ids, severities and descriptions follow the Android lint check documentation.
- Google Play field limits and language codes follow the Play Console help pages.
- CDATA behaviour follows the XML specification. Android's string documentation does not mention CDATA.
- Code samples follow those documents. The Python check script was run against sample files. The Kotlin, Gradle and XML samples were not compiled in a project for this guide.
- No app was built or tested on a device for this guide.
- Transglot facts follow its own documentation. The other tools named were not tested or benchmarked, so this guide makes no claim about which translates best.
Sources
- Android: String resources
- Android: Localize your app
- Android: Provide alternative resources
- Android: Language and locale resolution overview
- Android: Per-app language preferences
- Android: Test your app with pseudolocales
- Android: Support different languages and cultures
- Android: Unicode and internationalization support
- Android: Resources in Compose
- Android: Preview your UI with composable previews
- Android: Icons.AutoMirrored
- Android: VectorDrawable
- Android: DateTimeFormatter
- Android: android.icu.text.NumberFormat
- Android Studio: Improve your code with lint checks
- Android Studio: Tools attributes reference
- Android Studio: Localize the UI with Translations Editor
- Android Gradle plugin: ApplicationAndroidResources
- Android Gradle plugin: Lint
- Android Gradle plugin release notes
- Android lint checks: MissingTranslation
- Android lint checks: ExtraTranslation
- Android lint checks: MissingQuantity
- Android lint checks: StringFormatCount
- Play Console Help: Create and set up your app
- Play Console Help: Translate and localize your app
- Unicode CLDR: Language plural rules
- W3C: Extensible Markup Language (XML) 1.0, CDATA sections
- Transglot: Android XML format
- Transglot quickstart
- Transglot pricing