Building an In-App Language Picker That Works on Android
Language pickers on Android tend to fail quietly: English everywhere, no crash, no log line. These are the choices that keep ours working across 17 languages.

You add a language picker to an Android app, translate the strings, test it on your own device, and ship. Then users who pick Hindi or Arabic see English. Nothing crashes and nothing appears in the logs. The picker does what it was told, and the resources it needs are simply not on the device.
That is one of several ways an in-app language feature fails without telling you. A number lands on the wrong side of its label in Arabic. A plural reads wrongly in Russian. A notification stays in the system language after the UI has switched. None of these are exotic. They are what you get when a picker is built as a settings screen instead of as a locale change that touches the whole app.
Googly Player, our video, music and photo app, has a 17-language picker that is independent of the system language. This article covers how we built it, and which decisions stopped it from silently falling back to English.
A picker that ignores the system language
The picker is entirely independent of the device language. Someone with a phone set to English can run the app in Japanese, and someone on a Spanish device can run it in German. That rules out any approach that depends on the system locale being right, which is why the choices below matter.
The 17 languages are English, Hindi, Spanish, Arabic, French, Bengali, Portuguese, Russian, Urdu, Indonesian, German, Japanese, Turkish, Vietnamese, Korean, Italian and Gujarati. Two of them, Arabic and Urdu, are right-to-left, so the set tests layout as well as translation. A picker covering only left-to-right Latin-script languages can hide a lot of bugs.
How the list is presented
Each language is listed by its endonym, its own name in its own script, as the primary label, with the English name underneath. A user who cannot read English still finds 'हिन्दी', 'العربية' or '한국어' and does not have to hunt for the English word.
- The list is searchable.
- A 'Suggested' section at the top is based on the device locale.
- Arabic and Urdu names are anchored correctly in the picker, not left-aligned like their neighbours.
The device locale is used only for the suggestion. It never decides the language on its own. The user's choice does.
Applying the choice to the whole process
We apply the selected language through AppCompatDelegate.setApplicationLocales. That call sets the locale for the whole process, not for one screen. Services, notifications and dialogs follow the choice, not just activities.
This matters for a media player in particular. The playback notification is created by a service, not by an activity. If the locale were applied only at the activity level, the lock-screen controls could stay in the system language while the app itself showed the user's choice. Doing it process-wide removes that mismatch.
Android 13 and later: handing the choice to the platform
On Android 13 and later we hand the choice to the platform. The language then also appears under Settings › Apps › Googly Player › Language. The in-app picker and the system per-app setting stay in step, so a user who changes it in either place sees the same result.
We did not build a separate path to keep these in sync. Because the app uses the AppCompat call, the platform handles that part on Android 13+.
The App Bundle setting that makes translations vanish
This is the failure from the opening. With App Bundles, Play can split resources by language and deliver only the system-language resources to a given device. For an app with an in-app picker, that is a trap: the device has no strings for the language the user picked.
We deliberately disable language splits in the App Bundle, so every translation ships in the base APK. Without that, the picker would render everything in English with no crash and nothing in the logs. You can only find the bug by installing from a bundle on a device whose system language differs from the one you pick. A debug build installed straight from your IDE will never show it.
The cost is a larger base APK, since all 17 languages ship to everyone. We accepted that, because a language picker that cannot deliver its languages is not a feature.
Formatting counts instead of concatenating them
We format counts and never concatenate them. The string is Total Videos: %d, not "Total Videos: " + n. The reason is Arabic and Urdu: with concatenation the number ends up on the wrong side of the label in right-to-left text. A format string lets each translation position the number where its language needs it.
It is a small rule, but it has to hold everywhere. One concatenated string in a rarely visited screen is enough to break it. We apply it to every count the app displays, including the sectioned counts in search results.
Plurals need plural resources
Plurals use proper Android plural resources. Arabic needs six grammatical forms for a number and Russian needs four. A single format string, or even an 'item' versus 'items' pair, cannot express that.
With plural resources, the translator for each language supplies exactly the forms that language requires, and the platform picks the right one at runtime from the number. English keeps its two forms, and Arabic gets all six. The code that displays the count does not change per language.
Right-to-left support in full
Arabic and Urdu get full RTL support, not only mirrored text. That covers layout direction and the picker itself, where the language names are anchored correctly for right-to-left reading. It shows up in the same places as the count and plural rules above: anywhere the app joins a label and a number, or a word and its quantity.
Testing RTL means using the real languages, not a pseudo-locale alone. We have Arabic and Urdu in the app, so we can check the picker, the counts and the plurals against real strings.
What it takes to run
The language picker is part of Googly Player, our video, music and photo app. Here is what it relies on:
- AppCompat: the locale is applied through
AppCompatDelegate.setApplicationLocales. - Android 13 or later: for the language entry under Settings › Apps › Googly Player › Language. The in-app picker is the way to change language otherwise.
- App Bundle configuration: language splits disabled, so all 17 translations are in the base APK.
- Resources: format strings with placeholders for counts, and plural resources for quantities.
If you are building something similar, check the bundle configuration first. It is the one setting here that fails with no error.
- #Android RTL support
- #Android language picker
- #Android plurals
- #in-app language
- #localization
- #setApplicationLocales


Comments