Home | Resources | Blog

The Ultimate Guide to Android Localization

Android localization is the process of adapting your app for different languages and regions, from translating text to formatting numbers, currencies, and dates the way local users expect. Android handles much of this through its resource system: you keep translated strings in locale-specific folders, and the OS picks the right ones based on the user’s language settings.

Getting it right matters because Android is used worldwide, and many of your potential users will prefer an app in their own language. An English-only app can feel unfinished to them, and that hurts downloads, ratings, and retention in new markets.

This guide walks through Android internationalization (i18n) and localization (l10n) step by step, using a Jetpack Compose demo app. You’ll learn how to:

  • Add languages and translated strings to your project
  • Let users choose a language per app, including an in-app language picker
  • Format numbers, currencies, and dates for each locale
  • Handle plurals and strings with dynamic values
  • Localize accessibility labels for TalkBack
  • Test with pseudolocales before real translations arrive

Code for each step is available on GitHub, so you can follow along or jump to the section you need.

How does Android handle localization?

When it comes to multilingual Android apps, the mobile operating system relies on a combination of language and locale. Language is what gets translated, and locale dictates how regional settings related to the language are displayed: currency, time, dates, etc. Android users can go to Settings ➞ Languages and select a combination of language/locale, which would make all the installed apps adhere to them.

🗒 Note » A user can have multiple languages/locales selected and list them in order of priority. If the app doesn’t support the default language/locale, the next language/locale in the list will be used instead. If the app doesn’t support any of the languages/locales in the user’s list, it will display content from project’s default resources.

// Add this
<plurals name=”label_minutes”>
<item quantity=”one”>minute</item>
<item quantity=”other”>minutes</item>
</plurals>
🗒 Note » Besides one and other, Android also supports more attributes, including zero, two, few ,many. This allows for complex plurals, like those in Arabic, for example.

Now, in the Mainactivity.kt file, do the following:

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
// Current value of count entered by user in the TextField
var count by remember { mutableStateOf(“”) }
val resources = LocalContext.current.resources

Row(){
// …
TextField(
modifier = Modifier.width(80.dp),
value = count,
// If it (value entered by user) is empty, we set it to 0
onValueChange = { count = it.ifEmpty { “0” } },
keyboardOptions = KeyboardOptions.Default.copy(keyboardType = KeyboardType.Number),
)
Text(
// Pass the count/quantity to the getQuantityString() method
text = resources.getQuantityString(R.plurals.label_minutes, count.toInt()),
)
}
}
}
}
On running the final application, we can see that the correct string is loaded, respecting the entered quantity.

Timer demo app with dynamic adjustment of the word minute, depending on the quantity of minutes specified by the user | Phrase

How do I work with dynamic values in translated strings in Android?

Strings may sometime contain text that should not be translated into other languages. This could be a brand name, URL address, Unicode emoji character, an address, etc. You can use the <xliff:g> placeholder tag in the strings.xml file to mark text that should not be translated.

For example, our application displays the following text:

Demo app saying "Visit our website xy.com to learn more" | Phrase

Inside the Mainactivity.kt file, we have a Text composable.

setContent {

// …
Text(
text = getString(R.string.landing_url),
fontSize = 20.sp,
modifier = Modifier.padding(start = 10.dp)
)
}
}
}
And the associated key in strings.xml file in res ➞ values.

//For the German strings.xml file, similarly add this string
<string name=”landing_url”>Erfahren Sie mehr unter <xliff:g id=”application_homepage”>https://xyz.com/</xliff:g></string>
Always add an id attribute to the placeholder tag which explains what the placeholder is for. This is for your translators to understand the context of the untranslatable string. Let’s run the final version of the app in the English and German locales to see the difference.

Demo app saying "Visit our website xy.com to learn more" | Phrase

English

Demo app saying "Visit our website xy.com to learn more" in German | Phrase

German

Note the relative position of the URL is different in both languages.

🗒 Note » You can also use dynamic strings with <xliff:g> tags which will be displayed in run time.

How to localize accessibility for Android apps?

As briefly noted above, Android is using Talkback, Google’s reader included on all Android devices, to cater to people with disability. Talkback helps users navigate with gestures and describes the content displayed on the screen. It can also take advantage of all the strategies for i18n and l10n we have already discussed without any extra work. However, there are some APIs that are exclusively meant for accessibility.

When you define an Image or Icon composable, Talkback needs a textual description of the visual element. This can be achieved by adding a contentDesription parameter. For example, for an IconButton composable, contentDescription can be set by passing a string to the composable.

Now, Talkback will narrate the label in the user’s language. Check out our Android Accessibility Tutorial for Multilingual Apps to learn more.

Other best practices for Android internationalization

Let’s review briefly some other Android i18n best practices so you don’t miss anything:

  • Provide a sufficient description for string resources declared in the strings.xml file for the translator to understand the context in which a string is used. Instead of just declaring a string key in strings.xml file, provide comments explaining the context.
    <!-- The action for signing up after filling a form. This text is displayed on a button. -->
    <string  name="sign_up_button">Sign Up</string>
  • Design a flexible layout. It can be challenging to guess the exact width or height that a piece of text in any language will require on screens. For example, the English word “skip” takes only 4 characters but its German equivalent, “überspringen,” takes up 12 characters. Avoiding making widths and heights fixed—unless really important. Instead, make Composables wrap content or make them scrollable, depending on your use case. Check out a few examples of how to make localization-friendly layouts using Jetpack Compose.
  • Just as we defined different string.xml files for all locales, you can also add different images for all locales. Android will switch to default images in case it cannot find images for the user’s locale.

How do I test my Android app with pseudolocales?

Pseudolocalization is a method to simulate internationalization of text that might lead to UI, layout, and other translation-related issues while maintaining readability. Pseudolocalization helps you test localization without actually needing to translate your Android application. To use Android pseudolocales, you need to be running an API level 18 or higher.

Let us run an application whose default language is set to English, installed on a phone whose locale is set to en-UK.

Screen of demo app saying "Visit us at xyz.com to learn more" as well as a Next and Back button | Phrase

To enable pseudolocale testing on an Android device, go to the build.gradle file of your project and add the following code:

Sync and run the project. Now, turn on the developer options from the phone settings and restart your device or emulator. Android provides the following 2 pseudolocales to test your application.

  • English(XA): Adds Latin accents to base English UI text and expands on original text by adding non-accented text to showcase any UI bugs that might have originated because of expanded text.
  • AR(XB): Sets the direction of content from left-to-right(LTR) to right-to-left(RTL), reversing the order of characters; this is to mimic behaviour for various RTL languages like Hebrew, Urdu, etc.

Spotting localization issues

Navigate the phone settings and select English(XA) as the default system language. On running the app, when you select English(XA) as the default locale, you will notice the following:

Demo app with accents added to all of the English text except the Back button | Phrase

As we can see:

  • The Text composable and the Next button now contain added accents and expanded texts, which does not break out the UI. ✅
  • The Back button is same as before instead of using accents and expanded text. This means we have hard coded the string. ❌

Similar to that, you can select to run the app again after selecting AR(XB) as the default locale to check if there are any UI issues when viewing RTL locales.

🔗 Resource » Check out our guide to supporting RTL layouts in Android apps.

In conclusion, pseudolocalization has helped us fix UI issues without needing to translate our application.

Wrapping up our Android localization guide

And that about does it for this one. We hope you’ve enjoyed this foray into some best practices for making Android apps ready for global markets. As soon as your translators are ready to take over the process, have a look at Phrase Strings.

With its CLI and Bitbucket, GitHub, and GitLab sync, your i18n can be on autopilot. The fully-featured Phrase web console, with machine learning and smart suggestions, is a joy for translators to use. Once translations are ready, they can sync back to your project automatically. You set it and forget it, leaving you to focus on the code you love.

Check out all Phrase features for developers and see for yourself how they can streamline your app localization workflows.

Android localization FAQ

What is the difference between internationalization and localization in Android?

Internationalization (i18n) is preparing your app so it can support multiple languages and regions. That means removing hardcoded strings, using locale-aware formatters, and building flexible layouts. Localization (l10n) is adding the translations and regional conventions for each target locale. You do i18n once, then repeat l10n for every new market.

Where are translated strings stored in an Android project?

Each language has its own resource folder under res/, named with a locale qualifier, such as values-es/strings.xml for Spanish or values-ja/strings.xml for Japanese. The default values/strings.xml file holds your source-language strings and acts as the fallback.

What happens if a string is missing a translation?

Android falls back to the string in the default values/strings.xml, so users see untranslated text rather than a crash. Android Lint also flags missing translations, so you can catch them before release. Marking non-translatable strings with translatable="false" keeps them out of those warnings.

Does my Android app need to support right-to-left (RTL) languages?

Only if you target languages such as Arabic or Hebrew. To support them, set android:supportsRtl="true" in your manifest and use start and end instead of left and right in layouts and padding. You can check the result with the AR (XB) pseudolocale described above.

Can I offer per-app language selection on Android 12 and lower?

Yes. The system-level per-app language setting arrived in Android 13, but the AndroidX AppCompat library provides a backwards-compatible API (AppCompatDelegate.setApplicationLocales) for earlier versions. See the AndroidX note in the per-app locale section above.

Keep exploring

Blog post

Why high-quality automatic subtitling is harder than it looks

Subtitles are more than text on screen. Explore why segmentation, typography, and AI make automatic subtitling far more complex than it first appears.

Photo-realistic sheet music featuring developer-style translation code in place of musical notes. The staff lines show snippets like t('auth.signin.button') and JSON structures, combining the aesthetics of musical notation with programming syntax to illustrate the idea of “composable localization.”

Blog post

Localization as code: a composable approach to localization

Why is localization still a manual, disconnected process in a world where everything else is already “as code”? Learn how a composable, developer-friendly approach brings localization into your CI/CD pipeline, with automation, observability, and Git-based workflows built in.

A woman in a light sweater sits in a home office, focused on her laptop, representing a developer or content manager working on WordPress localization tasks in a calm, professional environment.

Blog post

How to build a scalable WordPress i18n workflow

WordPress powers the web, but translating it well takes more than plugins. Discover how to build a scalable localization workflow using gettext, best practices, and the Phrase plugin.

Two people wearing VR headsets back-to-back, illuminated by blue and purple neon light against a dark background.

Blog post

Localizing Unity games with the official Phrase plugin

Want to localize your Unity game without the CSV chaos? Discover how the official Phrase Strings Unity plugin simplifies your game’s localization workflow—from string table setup to pulling translations directly into your project. Whether you’re building for German, Serbian, or beyond, this guide shows how to get started fast and localize like a pro.

Blog post

Internationalization beyond code: A developer’s guide to real-world language challenges

Discover how language affects your UI. From text expansion to pluralization, this guide explores key i18n pitfalls and best practices for modern web developers.