Getting a language range for the current Android user

263 Views Asked by At

I am writing an Android App that fetches data via HTTP. The server side implementation is fully aware of IETF BCP 47 (including RFC 4647). It parses the Accept-Language header and takes into account language preferences of the user with graceful fallback.

In order to make use of those capabilities, it would be great to (at least have the possibility to) get more than just one language from Android.

In Chrome for example I can add multiple languages and order them by my personal preference. I do not know of this capability on the Android Platform.

Currently, I just Locale.getDefault(), but I'd rather like to work with List<Locale.LanguageRange> (from Java 8) that comes from the browser via Accept-Language.

  1. Did I overlook the correct Android API? If so, please repoint me.
  2. Does Android even support that? If not, why not? Is it planned?
1

There are 1 best solutions below

0
On BEST ANSWER

Did I overlook the correct Android API?

No.

Does Android even support that?

No.

You are welcome to implement your own multi-select list of locales and ask the user which additional ones (beyond their device setting) they want to use with your app. The user has no means, at the device level, of specifying multiple locales.