How Googly Player runs in 17 languages, independently of the phone's language

Seventeen languages, chosen inside the app and applied everywhere it speaks. Plus the App Bundle setting that quietly breaks an in-app language picker if it is left on.

Binary Buddies · 5 min read · 1 view
An evening balcony above a cityA phone glows on a balcony table at dusk, above a skyline of domes and towers with lit windows, under string lights and a rising moon.

An in-app language picker is easy to add and easy to get quietly wrong. The failures rarely crash anything. The screens switch language but a notification raised by a background service does not. A count reads with the number on the wrong side of its label in Arabic. Or, worst of all, the picker lists every language, the user chooses one, and the whole app renders in English anyway, with nothing in the logs to say why.

For a media app the problem is sharper, because so much of what the user sees lives outside the main screens: the playback notification, dialogs, work done while the app is in the background. A language setting that only reaches the activities is visibly half-finished.

Googly Player, our Android player for videos, music and photos, ships 17 languages through its own picker, independent of the system language. Below is what that picker does, the Android mechanisms behind it, and the release-configuration decision without which none of it would work on a real device.

Key takeaways

  • The app language is chosen inside Googly Player and does not depend on the phone's system language; on Android 13 and later the same choice also appears in system Settings.
  • The choice is applied process-wide with AppCompatDelegate.setApplicationLocales, so services, notifications and dialogs follow it, not just activities.
  • Language splits are disabled in the App Bundle. With them on, the picker would silently render everything in English.
  • Arabic and Urdu get full right-to-left support, counts use format strings, and plurals use proper plural resources: six forms in Arabic, four in Russian.

Seventeen languages, chosen inside the app

The picker is a full in-app setting, entirely separate from the language the phone itself is set to. That matters for anyone whose device language and preferred reading language differ. Each language is listed under its own name, in its own script, with the English name beneath it. These are the 17 it offers:

Listed asEnglish name
EnglishEnglish
हिन्दीHindi
EspañolSpanish
العربيةArabic
FrançaisFrench
বাংলাBengali
PortuguêsPortuguese
РусскийRussian
اردوUrdu
Bahasa IndonesiaIndonesian
DeutschGerman
日本語Japanese
TürkçeTurkish
Tiếng ViệtVietnamese
한국어Korean
ItalianoItalian
ગુજરાતીGujarati

The list spans five scripts that read left to right and two languages, Arabic and Urdu, that read right to left. Supporting that spread properly takes more than a strings file per language, and most of the rest of this article is about the parts that are not translation at all: where the locale is applied, how the build ships it, and how numbers and plurals are put together.

A picker that reads in the reader's own script

Each entry uses the language's endonym, its own name in its own script, as the primary label, with the English name underneath. The ordering is deliberate. A Bengali reader recognises বাংলা faster than the word Bengali, and a picker that lists only English names asks people to find their language through a language they may not read. The English line underneath keeps every entry usable for someone who reads only English, or who is helping somebody else set up the phone.

The list is searchable, and it includes a Suggested section based on the device locale, so the likeliest choices do not have to be hunted for among 17. The suggestion comes from the device; the decision stays with the user, which is the point of an in-app picker in the first place.

How the language picker lists each languageEach entry shows the language's own name in its own script, with the English name underneath. Around the list: search, a Suggested section from the device locale, and all 17 languages.One entry in the pickerहिन्दीHindiEndonym, in its own scriptEnglish name underneathAround the listSearchable listSuggested from localeAll 17 languages
Every entry leads with the language's own name and keeps the English name as a second line.
Lanterns under an arcade at nightA row of arches with a lantern glowing in each, under a crescent moon and a starry evening sky.

Right-to-left for Arabic and Urdu

Arabic and Urdu get full right-to-left support across the app. Layout mirrors, so text, controls and reading order run from the right edge rather than being left-aligned English layouts with translated strings dropped into them. A right-to-left user should not have to read a screen backwards to use it.

The picker itself needs particular care here, because it is the one screen where right-to-left and left-to-right text sit side by side in the same list. العربية and اردو appear next to Deutsch and 日本語, and each language name is anchored correctly, rather than every entry inheriting the alignment of whichever language the app happens to be in at that moment. Get this wrong and the picker looks broken in exactly the languages that needed the most work.

Applied to the whole process, not just the screens

The selected language is applied process-wide through AppCompatDelegate.setApplicationLocales. That call sets the locale for the application as a whole, so it covers services, notifications and dialogs as well as activities. Approaches that only override the locale on activities leave everything else speaking the system language.

In a media player, that everything-else is a large share of what the user sees. Googly Player uses a foreground service for media playback so audio can keep playing in the background, and on Android 13 and later it posts a media notification. Neither lives inside an activity. Setting the language at process level is what keeps the notification shade, a confirmation dialog and the main screen all in the same language.

One locale setting reaching every surfaceThe in-app picker sets the locale through setApplicationLocales, which applies it to activities, services, notifications and dialogs, and on Android 13 and later also surfaces it in system Settings.One setting, every surfaceIn-app language pickerAndroid 13+ system SettingssetApplicationLocalesActivitiesServicesNotificationsDialogs
The choice is set once at application level, so the playback notification and dialogs follow it along with the screens.

On Android 13 and later, the platform holds the setting

From Android 13, Android has its own per-app language setting, and Googly Player hands the choice to the platform. The language picked inside the app also appears under Settings › Apps › Googly Player › Language, so the system and the app describe the same thing instead of keeping two competing preferences.

In practice this means the language can be found and changed from either place. Someone who goes looking for it in the phone's Settings finds it where Android says per-app languages live; someone who never leaves the app uses the picker. On earlier Android versions there is no system-level equivalent, and the in-app picker is the place to set it.

The App Bundle setting that fails without a trace

Android App Bundles let Google Play split an app's resources by language and deliver only the ones that match the device. For most apps that saves space. For an app with its own language picker it is a trap: Play delivers only the system-language resources, so the other translations are simply not on the phone.

The result is the failure described at the top of this article. The picker lists all 17 languages, the user chooses one, and everything renders in English. There is no crash and nothing in the logs, because from Android's point of view nothing went wrong: it asked for strings in a language the installed package did not contain, and fell back to the default.

Language splits on versus disabledWith language splits on, only the system language is shipped and the picker silently shows English. With splits disabled, every translation is in the base APK and the chosen language renders.Language splits onLanguage splits disabledOnly system language shippedPicker silently shows EnglishEvery translation in base APKChosen language renders
The left-hand path produces no crash and no log entry, which is why it is easy to ship by accident.

Numbers and plurals that survive translation

Every count in the app is formatted, never concatenated. A label is written as a format string such as "Total Videos: %d", not built as "Total Videos: " + n. Concatenation fixes the number to the end of the English word order, and in Arabic and Urdu that puts the number on the wrong side of the label. A format string lets each translation place the number where its own grammar needs it.

Plurals go through proper plural resources rather than format strings. A single format string can only hold one shape of sentence, but languages disagree about how many shapes a number needs: Arabic has six grammatical forms for a count and Russian has four. Plural resources let each translation supply every form its language uses, and Android picks the right one for the number at runtime.

17languages in the in-app picker
2right-to-left languages: Arabic, Urdu
6plural forms a count needs in Arabic
4plural forms a count needs in Russian
Concatenated versus formatted countsConcatenating a label and a number puts the number on the wrong side in Arabic and Urdu; a format string keeps it on the correct side.Where the number landsConcatenated"Total Videos: " + nWrong side in Arabic, UrduFormatted"Total Videos: %d"Correct side in Arabic, Urdu
A format string leaves word order to each translation; joining strings in code fixes it to English.
A train crossing a bridge at dawnA two-car train with lit windows crosses a long bridge over water at sunrise, with layered hills, drifting mist and birds overhead.

What it runs on, and what to check in your own app

Googly Player is an Android app, and the language support behaves slightly differently depending on the Android version:

  • Any supported Android version: the in-app picker with all 17 languages, applied process-wide.
  • Android 13 and later: the choice is also handed to the platform and appears under Settings › Apps › Googly Player › Language.
  • No extra download per language: every translation ships in the base APK, so switching language never depends on what Play delivered to the device.
  • Right-to-left: full support for Arabic and Urdu, including in the picker itself.

If you are building an Android app with its own language setting, the same decisions apply to your project. Set the locale with AppCompatDelegate.setApplicationLocales rather than per activity, so services, notifications and dialogs follow it. Check whether your App Bundle splits resources by language, because if it does, an in-app picker cannot work for any language other than the device's. Search your code for counts joined onto labels and replace them with format strings, and move any count that changes with the number into plural resources, so Arabic can use all six of its forms and Russian all four.

Questions

Does Googly Player have to use my phone's system language?

No. The language is chosen in the app's own picker and is independent of the system language. The picker does use the device locale to fill its Suggested section, but the choice is yours.

Will notifications and dialogs change language as well as the main screens?

Yes. The language is applied process-wide through AppCompatDelegate.setApplicationLocales, which covers services, notifications and dialogs, not just activities.

Can I change Googly Player's language from Android Settings?

On Android 13 and later, yes. The choice is handed to the platform and appears under Settings › Apps › Googly Player › Language. On earlier versions, use the in-app picker.

Why would an in-app language picker show everything in English?

Usually because the App Bundle splits resources by language, so Play only delivers the device's system language. Googly Player disables language splits so every translation is in the base APK, which prevents exactly this.

How are counts handled in Arabic and Russian?

Counts are written as format strings, so the number sits on the correct side of its label in Arabic and Urdu, and plurals use plural resources so Arabic gets its six grammatical forms and Russian its four.

  • #Android localization
  • #Android plurals
  • #Googly Player
  • #RTL Arabic Urdu
  • #in-app language picker
  • #setApplicationLocales

Comments

Add a comment
Sign in with Google to join the conversation