Skip to content

Optional analytics, session recording and advertising stay off unless you accept. You can reject them and use Transglot. Change your choice anytime in Cookie preferences. Cookie Policy

Back to the blog
Developer platform

Android Localization: The Complete Guide (2026)

How to localize an Android app in 2026: strings.xml, plurals, per-app language, right to left, lint checks, Play listings and checking AI translations.

by transglot team
published November 23, 2026
25 min read

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.

res/values/strings.xml, the default resourcesxml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" translatable="false">Fieldnote</string>
<!-- Button on the sign-in form. Fits about 30 characters. -->
<string name="login_submit_button">Sign in</string>
<string name="welcome_messages">Hello, %1$s! You have %2$d new messages.</string>
</resources>

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:

texttext
res/
values/strings.xml default, every string
values-fr/strings.xml French
values-pt-rBR/strings.xml Portuguese, Brazil
values-b+es+419/strings.xml Spanish, Latin America
values-b+zh+Hant/strings.xml Chinese, Traditional script
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.
Rule

Naming the folders

There are two spellings for a locale qualifier, and both are valid.

FormExampleUse it when
Language onlyvalues-frOne translation serves every region. This is the usual case.
Language and regionvalues-pt-rBR, values-en-rGBA region needs its own text. The region code takes a lowercase r prefix.
BCP 47 tagvalues-b+es+419, values-b+zh+Hant, values-b+sr+Latn+RSYou 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.

StepBefore Android 7.0Android 7.0 and later
1Try fr_CH, failTry fr_CH, fail
2Try fr, failTry fr, fail
3Use the default (English)Try children of fr, find fr_FR
ResultEnglishFrench

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, not values-fr-rFR. Android recommends the most common parent dialect: values-b+es+419 for Latin American Spanish instead of values-es-rUS, and values-b+en+001 for international English instead of values-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.
A stack of cream paper drawers labelled by language, with one drawer pulled open
Android opens the closest matching values folder, then falls back to the default

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:

app/build.gradle.kts, AGP 8.8 or laterkotlin
android {
androidResources {
localeFilters += listOf("en", "fr", "pt-rBR", "b+es+419")
}
}
Several Android guide pages still show resConfigs or resourceConfigurations for this. The plugin's DSL reference marks resourceConfigurations as deprecated in 8.8.0 and points to androidResources.localeFilters.
Watch out

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.

Kotlin, Compose BOM 2026.09.00kotlin
@Composable
fun WelcomeMessage(username: String, mailCount: Int) {
Text(
text = stringResource(
R.string.welcome_messages,
username,
mailCount,
)
)
}
// Outside a composable
val text = context.getString(R.string.welcome_messages, username, mailCount)

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.

res/values/strings.xmlxml
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="countdown">
<xliff:g id="time" example="5 days">%1$s</xliff:g> until holiday
</string>
</resources>

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

res/values/strings.xmlxml
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="app_name" translatable="false">Fieldnote</string>
<string name="support_email" translatable="false">help@example.com</string>
<string name="beta_banner" tools:ignore="MissingTranslation">Beta</string>
</resources>

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.

res/values/strings.xmlxml
<string-array name="planets_array">
<item>Mercury</item>
<item>Venus</item>
</string-array>

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.

CharacterWrite 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&lt; and &amp; (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>.

xmlxml
<string name="welcome">Welcome to <b>Android</b>!</string>

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:

xmlxml
<string name="welcome_html">Hello, %1$s! You have &lt;b>%2$d new messages&lt;/b>.</string>
Kotlin. htmlEncode() protects user text that contains HTML characterskotlin
@Composable
fun WelcomeHtmlMessage(username: String, mailCount: Int) {
val text = stringResource(
R.string.welcome_html,
TextUtils.htmlEncode(username),
mailCount,
)
Text(text = AnnotatedString.fromHtml(text))
}

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 &lt;. 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.

res/values/strings.xmlxml
<plurals name="numberOfSongsAvailable">
<item quantity="one">%d song found.</item>
<item quantity="other">%d songs found.</item>
</plurals>
Kotlin. The count is passed twicekotlin
@Composable
fun SongCount(count: Int) {
Text(
text = pluralStringResource(
R.plurals.numberOfSongsAvailable,
count,
count,
)
)
}
// Outside a composable
val text = context.resources.getQuantityString(
R.plurals.numberOfSongsAvailable, count, count
)

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.

LanguageCardinal categories (CLDR)
Japanese, Chinese, Korean, Thai, Indonesianother
English, German, Dutch, Swedish, Turkishone, other
French, Spanish, Italian, Portugueseone, many, other
Hebrewone, two, other
Romanianone, few, other
Russian, Ukrainian, Polish, Czech, Lithuanianone, few, many, other
Slovenianone, two, few, other
Arabic, Welshzero, one, two, few, many, other

A Polish file therefore has four items where the English one has two:

res/values-pl/strings.xmlxml
<plurals name="numberOfSongsAvailable">
<item quantity="one">Znaleziono %d piosenkę.</item>
<item quantity="few">Znaleziono %d piosenki.</item>
<item quantity="many">Znaleziono %d piosenek.</item>
<item quantity="other">Znaleziono %d piosenki.</item>
</plurals>
Six cream paper tiles in a row, some raised, each stamped with a plural category
Each language raises only the plural categories its grammar uses
Always put %d in the one string. In Russian, one covers 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.
Rule

Three more rules from the Android documentation:

  • Use plurals only for grammar. Do not use zero to show "No messages". Chinese and Korean only ever return other, so the special case never appears. Use an if in 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

ApproachFits
<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 textLabels 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.

app/build.gradle.ktskotlin
android {
androidResources {
generateLocaleConfig = true
}
}
propertiesproperties
unqualifiedResLocale=en-US

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.

With generateLocaleConfig on, the build fails if a hand-written LocaleConfig file also exists. Delete the manual locale_config.xml first. The generated list also includes locales that come from library modules, so make sure each of those is ready to ship.
Watch out

The manual way

If you need a list that differs from your folders, write it yourself and point the manifest at it:

res/xml/locale_config.xmlxml
<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
<locale android:name="en-US"/>
<locale android:name="fr"/>
<locale android:name="ja"/>
<locale android:name="zh-Hans-MO"/>
</locale-config>
AndroidManifest.xmlxml
<application
android:localeConfig="@xml/locale_config">
</application>

Locale names here use dashes (zh-Hans-MO), not the folder spelling. Include the default language of res/values.

generateLocaleConfigManual locale_config.xml
Stays in sync with new values-* foldersYesNo, you edit it
Lets you hide a language that is not readyNoYes
Build requirementAGP 8.1 or later, compileSdk 33 or laterNone 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.

Kotlin, AppCompat 1.6.0 or laterkotlin
// Set the app language. Call on the main thread: it may recreate the Activity.
AppCompatDelegate.setApplicationLocales(
LocaleListCompat.forLanguageTags("fr")
)
// Read it back
val current = AppCompatDelegate.getApplicationLocales()
// Return to the system language
AppCompatDelegate.setApplicationLocales(LocaleListCompat.getEmptyLocaleList())

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:

AndroidManifest.xml, inside <application>xml
<service
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
android:enabled="false"
android:exported="false">
<meta-data
android:name="autoStoreLocales"
android:value="true" />
</service>

Part 6: right to left

Arabic, Hebrew, Persian and Urdu are written right to left. Supporting them takes three steps.

  1. Declare support. Add android:supportsRtl="true" to the <application> element.
  2. Replace left and right with start and end. paddingLeft becomes paddingStart, layout_marginRight becomes layout_marginEnd, gravity="left" becomes gravity="start". In Compose, padding values are already defined as start and end, and resolve to left or right from the layout direction.
  3. Mirror directional images. A back arrow must point the other way. For a vector drawable, set android:autoMirrored="true". In Compose, use the Icons.AutoMirrored set, for example Icons.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:

Kotlin. unicodeWrap() declares the direction of the inserted textkotlin
val bidi = BidiFormatter.getInstance()
val text = context.getString(
R.string.did_you_mean,
bidi.unicodeWrap(suggestion),
)

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.

Kotlin, inside a composable. Pass the result to a %1$s argumentkotlin
import android.icu.text.NumberFormat
import android.icu.util.Currency
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import java.time.format.FormatStyle
val locale = LocalConfiguration.current.locales[0]
// Date: java.time, API level 26 and later
val date = DateTimeFormatter
.ofLocalizedDate(FormatStyle.MEDIUM)
.withLocale(locale)
.format(LocalDate.now())
// Number and currency: android.icu, API level 24 and later
val count = NumberFormat.getInstance(locale).format(1234567.89)
val price = NumberFormat.getCurrencyInstance(locale).apply {
currency = Currency.getInstance("EUR")
}.format(19.99)

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:

PseudolocaleTagWhat it doesWhat it reveals
English (XA)en-XAAdds accents, makes text longer, wraps each message in bracketsClipped text, hardcoded strings (they stay unaccented), concatenated sentences (they show as several bracketed pieces)
AR (XB)ar-XBReverses the text directionLayouts that do not mirror, misplaced punctuation

Enable them for debug builds only:

app/build.gradle.ktskotlin
android {
buildTypes {
getByName("debug") {
isPseudoLocalesEnabled = true
}
}
}

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.

Run en-XA and ar-XB once before you send anything for translation. Every problem they show is cheaper to fix now than after 20 languages have been translated around it.
In short

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, run setprop persist.sys.locale fr-CA;stop;sleep 5;start and 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

FailureExampleResult
Format argument changed%2$d returned as %2$s, % 1$s, or droppedWrong value, or an exception at runtime when the string is formatted
Position lost%1$s and %2$s returned as two %sArguments print in the wrong order after reordering
Apostrophe not escapedl'invitation in French, where the English had noneBreaks 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 EnglishPolish returned with only one and otherMissing forms for 2 to 4 and for 5 and up
Plural categories inventedzero added to an English or German fileNever shown, since the language does not use it
%d removed from one"Одна песня" for the Russian oneWrong for 21, 31, 101
Markup altered<b> translated, moved outside its words, or &lt;b> unescaped to <b>Styling lost, or a format string that no longer formats
<xliff:g> content translatedThe example product name translatedA value that was marked as fixed has changed
Array length changedTwo items merged into oneEvery later item is shifted by one
Key invented or renamedA name that does not exist in the default fileExtraTranslation fails the release build
A cream paper conveyor carrying string cards through four small gates, with one card set aside
Each translated string passes placeholder, escaping, plural and markup checks before it is written

How to check it

Android lint already knows most of these. The relevant issue ids, all part of the built-in checks:

Lint idDefault severityCatches
MissingTranslationErrorA string in the default file with no translation in a locale
ExtraTranslationFatalA translated string with no default. Also enforced in release builds
StringFormatInvalidErrorA format string that would throw at runtime
StringFormatMatchesErrorThe same numbered argument with different types across translations
StringFormatCountWarningA different number of arguments across translations
MissingQuantityErrorA plural missing a category its language needs
UnusedQuantityWarningA plural with a category its language never uses
ImpliedQuantityErrorA 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:

app/build.gradle.ktskotlin
android {
lint {
abortOnError = true
error += setOf("StringFormatCount", "UnusedQuantity")
}
}

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:

check_strings.py. Run as: python3 check_strings.py app/src/main/respython
import re, sys, pathlib
import xml.etree.ElementTree as ET
ARG = re.compile(r"%(\d+\$)?[-#+ 0,(]*\d*(\.\d+)?[sdfxc]")
def load(path):
out = {}
for el in ET.parse(path).getroot():
if el.tag == "string":
out[el.get("name")] = "".join(el.itertext())
elif el.tag == "plurals":
for item in el:
out[el.get("name") + "#" + item.get("quantity")] = "".join(item.itertext())
return out
def args(text):
return sorted(m.group(0) for m in ARG.finditer(text))
res = pathlib.Path(sys.argv[1])
base = load(res / "values" / "strings.xml")
failed = False
for folder in sorted(res.glob("values-*")):
file = folder / "strings.xml"
if not file.exists():
continue
for key, text in load(file).items():
name = key.split("#")[0]
source = base.get(key) or next((v for k, v in base.items() if k.split("#")[0] == name), None)
if source is not None and args(source) != args(text):
print(f"{file}: {key}: expected {args(source)}, found {args(text)}")
failed = True
if re.search(r"(?<!\\)'", text) and not text.startswith('"'):
print(f"{file}: {key}: unescaped apostrophe")
failed = True
sys.exit(1 if failed else 0)

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

ApproachHow it worksFits
Translate by hand in the Translations EditorAndroid Studio shows every key and language in one gridOne or two languages, a small app
Gemini in Android StudioTranslates string resources inside the projectA quick first draft with the developer reviewing
Play ConsoleOrder paid human translation of app strings and listing text from a vendor, or opt in to automatic translation of app stringsTeams that want a vendor without choosing one
A script and a model APIYour code sends changed strings and writes the filesMany languages, engineers who will own the checks above
A localization platformA service reads strings.xml, translates, checks and gives reviewers an editorMany 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.

FieldCharacter limit
App name30
Short description80
Full description4,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-419 for Latin American Spanish, iw-IL for Hebrew, and zh-CN and zh-TW for Chinese. Map them to your values-* 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:

The localization steps of a CI jobbash
# 1. Format arguments and apostrophes against the default file
python3 check_strings.py app/src/main/res
# 2. Missing, extra and malformed translations, plural quantities
./gradlew lintRelease
# 3. The release build, which enforces fatal lint issues such as ExtraTranslation
./gradlew assembleRelease

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:

bashbash
npx transglot@latest init --targets fr,de,es,pl

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:

yamlyaml
name: transglot
on:
push:
branches: [main]
jobs:
localize:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: transglot/transglot-action@v1
with:
token: ${{ secrets.TRANSGLOT_TOKEN }}
url: https://api.transglot.ai

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 zero item 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-xx folder. 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 %s twice 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 one string. Wrong for 21 in Russian.
  • Passing the count once to pluralStringResource(). The form is chosen but %d has no value.
  • paddingLeft and layout_marginRight in a layout. They do not mirror.
  • A date pattern in strings.xml. Use DateTimeFormatter.ofLocalizedDate().
  • Enabling generateLocaleConfig without reading the generated list. It is built from library modules too.
  • setApplicationLocales in an activity that does not extend AppCompatActivity. Nothing happens.
  • Trusting a translated file because it parses. Valid XML can still have a missing %d or a missing plural form.

Checklist

texttext
Strings
[ ] Every user-facing string is in res/values/strings.xml
[ ] Each string has a comment where the meaning or the space is not obvious
[ ] Names, URLs and codes are marked translatable="false"
[ ] Variables use positional arguments (%1$s, %2$d)
[ ] Counts use <plurals>, with %d in every item
[ ] No sentence is assembled from fragments in code
Folders and build
[ ] Translations sit in parent-language folders (values-fr, values-b+es+419)
[ ] androidResources.localeFilters lists the supported languages
[ ] generateLocaleConfig is on, with res/resources.properties
[ ] android:supportsRtl="true" is set
Layout and formatting
[ ] Layouts use start and end, directional icons are auto-mirrored
[ ] Dates, numbers and currency go through the platform formatters
[ ] en-XA and ar-XB pseudolocales pass on the smallest supported screen
Translation and checks
[ ] Format arguments match the default file in every language
[ ] Apostrophes, quotes, @ and ? are escaped
[ ] Each plural has the categories its language needs
[ ] ./gradlew lintRelease passes with MissingTranslation and ExtraTranslation on
[ ] A person has read the first screens in each language
Store
[ ] App name (30), short description (80) and full description (4,000) fit
[ ] Play language codes are mapped to values folders
[ ] Screenshots are localized for the main languages

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

colophon

Who wrote this, and what to read next

wrote this

transglot team

The byline on this post has no profile yet. Author profiles are managed alongside the posts themselves.

Engineering
keep reading

How to Localize a Mobile App into 20 Languages Quickly

A five-step plan to take an iOS, Android or Flutter app from one language to twenty: prepare the strings, translate with AI, check plurals and layout, then ship.

November 23, 2026
9 min read
keep reading

App Localization Guide for Product Teams

Plan app localization around complete user journeys. Learn how to scope a locale, prepare resources, review translations, test releases and maintain the experience.

August 26, 2026
20 min read
keep reading

Automated localization QA with Transglot

Catch broken placeholders, incomplete plurals and terminology conflicts. Learn what automated QA proves, where human review matters and how to validate a release.

March 31, 2026
6 min read
works with what you already run

41 connectors, already built.

the pipeline this post describes

Try it on your own strings. Free, no card.

Free plan: 100,000 words to start (25,000 at sign-up, 75,000 after a phone check), then 10,000 a month, 15 locales including your source, 3 seats.