0

I have an app I want to operate in several European countries - Germany, Poland, Czech Republic. We will be shipping it on some Samsung Galaxy Tab 4 tablets running Lollipop 5.02.

When I go to Settings... Languages and Input the only language choices it shows on our device are English, Spanish, French, Chinese, and Korean. But this S.O. question shows a much longer list of "supported" languages in the OS: What is the list of supported languages/locales on Android?

... So what precisely does it mean for a language to be "supported" in Android?

In https://developer.android.com/training/basics/supporting-devices/languages.html they make it seem like it's just matter of adding stuff in the string resource files, but I don't see how that will update the settings or available fonts. How do I add a "supported" language to the choices (and the associated glyphs, etc) in Settings...Language and Input? Is there a way to do that programatically from our app?

I can see apps on Google Play that claim to be able to add language support to a device, but if all the languages listed in that SO Question (above) are already "supported" what do they do? Is language support considered an attribute of the application or the operating system on in the Android universe?

Community
  • 1
  • 1
user316117
  • 7,971
  • 20
  • 83
  • 158

1 Answers1

1

So what precisely does it mean for a language to be "supported" in Android?

In terms of the OS itself, it means that strings and other locale-specific resources are available to device manufacturers. Usually, this also means that currently-maintained apps in the Android Open Source Project (AOSP) also support the same languages.

This does not mean that device manufacturers are forced to include those resources. Device manufacturers routinely remove unnecessary resources, where "unnecessary" is determined by the market(s) in which they are distributing the particular device.

We will be shipping it on some Samsung Galaxy Tab 4 tablets running Lollipop 5.02.

Part of your decision criteria for your device choice should have been "will it support the languages that I want?". For example, a Galaxy Tab 4 purchased in Germany is more likely to support German than is a Galaxy Tab 4 purchased in Greece, Georgia (the republic), or Georgia (the US state).

On the whole, from what I've seen, Nexus/Pixel devices do the best job of supporting all the languages that the AOSP offers.

How do I add a "supported" language to the choices (and the associated glyphs, etc) in Settings...Language and Input?

Install a custom ROM that has those resources. Or, create your own custom ROM that has those resources.

In principle, on a rooted device, you might be able to add resources, but you would not only need to supply standard Android resources, but other resources that the device manufacturer may have added, either to the core OS or to pre-installed apps. This part would be difficult, at best.

Is there a way to do that programatically from our app?

No.

Is language support considered an attribute of the application or the operating system on in the Android universe?

Both. Or, more accurately:

  • Google determines what languages are available for Android as an open source operating system.

  • Device manufacturers determine what languages that they will support on a given device. Nowadays, that is usually a subset of the AOSP-supported languages, or at best all of the AOSP-supported languages. Device manufacturers used to create their own translations for languages that Android lacked but were relevant to markets that the manufacturers wanted to support. My guess is that this is less common nowadays, though it probably still happens to some extent.

  • App developers determine what languages their own apps will support, in terms of string translations and related locale-specific resources that are unique to their app.

From the user's standpoint, the relevant part is the intersection of what their device supports and what their desired apps support.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • If installing a custom ROM is the only way to add language (glyph, etc) support then this implies that app-writers, who obviously have no control over the devices their customers are running on, cannot write apps for languages outside of a small subset of whatever is likely to be shipped on the most generic devices, eg. Spanish, English, Chinese. But I see apps all the time targeting Russian or Bengali or Greek or Hebrew (etc) Are those app-writers assuming that their customers are rooting their devices? – user316117 Nov 11 '16 at 18:14
  • @user316117: "If installing a custom ROM is the only way to add language (glyph, etc)" -- that is not what I was discussing in my answer, and it has little to do with your question. The available languages in Settings is based on what **string translations** the device manufacturer has elected to ship. The base OS font is likely to support much more than that. If the manufacturer leaves the base OS font alone (as they should), the device can *render* any language supported for that version of Android. – CommonsWare Nov 11 '16 at 18:21
  • @user316117: As such, developers can ship apps that support a wide range of languages. The precise roster of languages has steadily increased. And for languages that require a substantially different set of glyphs, the developer may elect to embed their own font that supports those glyphs, either to ensure that they can run on older devices, to ensure that they can run even if device manufacturers mess with the fonts, or to use some language that Android does not offer yet (e.g., Sanskrit, Klingon). – CommonsWare Nov 11 '16 at 18:23
  • @user316117: What a developer cannot do, short of rooting, is replace the default font with a different font. However, even replacing the default font does not magically cause the Settings app to show new languages, as just because a font change may have added glyphs, there still may not be translations in the OS itself (as shipped by the manufacturer) that leverage those glyphs. To add *complete device support for a language*, including all the messages that the device shows the user, will require replacing the ROM with one that you control. – CommonsWare Nov 11 '16 at 18:25
  • But to select the language doesn't it have to be available in the Settings...Language and Input dropdown? In other words, if I have an app that I want to appear in Czech (say), I can create a set of string resources in a folder with "-cs", but to get it to use those strings I have to tell it I'm in Czech by setting my locale in Settings ...Language and Input to Czech. So how is that done if that option's not available? – user316117 Nov 11 '16 at 18:30
  • @user316117: To take this beyond Android, developers of Windows programs and Web sites are welcome to support Klingon. Most likely, they would use their own font (e.g., Web font), to ensure that they have a font that offers Klingon glyphs. However, a Web site cannot cause *Windows* to support Klingon, and AFAIK a Windows program cannot cause *Windows* to support Klingon, as the program cannot readily modify the Control Panel nor supply Klingon translations for all Windows OS messages. – CommonsWare Nov 11 '16 at 18:31
  • @user316117: "But to select the language doesn't it have to be available in the Settings...Language and Input dropdown?" -- yes. That controls the OS messages and controls what locale-specific resources apps use. However, users usually buy a device that supports a language that they can read, and so app developers aren't especially worried about that part. "So how is that done if that option's not available?" -- Czech users buy devices that have support for Czech, and so the option is available. – CommonsWare Nov 11 '16 at 18:33
  • So to take your Klingon example, after I've created my Klingon string files how do I tell it to set my locale into Klingon if that's not one of the options in the "Language and Input" dropdown so that it uses my Klingon strings. (same question applies to Greek, Russian, Bengali, etc) – user316117 Nov 11 '16 at 18:35
  • @user316117: "how do I tell it to set my locale into Klingon" -- you wouldn't. AFAIK, Klingon isn't a supported language in any version of Android, which means that the only devices that might have that as an option would be those sold on the Klingon home world, which doesn't exist. However, app developers are welcome to display strings that aren't pulled from locale-specific resource directories, or use `Locale` to change what locale their process uses to be different from the one the user selected in the device. – CommonsWare Nov 11 '16 at 18:39
  • @user316117: In the early days of Android, device manufacturers would limit the number of languages on a device in an effort to reduce the size of the firmware, as they would ship fewer strings, which take up space. Nowadays, we seem to have ample room. Ideally, the Galaxy Tab 4 would ship with all languages for all markets where Samsung is intending to sell the Galaxy Tab 4. It's possible that this still would not cover all your target markets, as you cannot force Samsung to translate their strings to arbitrary languages. – CommonsWare Nov 11 '16 at 18:40
  • So to summarise all this verbiage, in Android app writers must assume users have purchased hardware that already supports the language they want. (unless they're geeky enough to root their devices). Earlier you mentioned Windows, but in Windows I've shipped programs that were 100% localized including fonts. system messages, etc, because you can buy language packs from Microsoft to install with your program, if they're not already on the PC. That was with XP - I don't know if they still have those. – user316117 Nov 11 '16 at 18:42
  • @user316117: "in Android app writers must assume users have purchased hardware that already supports the language they want" -- correct. After all, if the user cannot understand the system prompts, the device is useless, well before the app is even a consideration. – CommonsWare Nov 11 '16 at 18:43