找到你要的答案

Q:Getting a language range for the current Android user

Q:获取当前Android用户的语言范围

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?

我在写一个Android应用程序将数据通过HTTP。服务器端实现充分意识到BCP 47(包括IETF RFC 4647)。它将接受语言头为优美的回退用户帐户语言偏好。

为了利用这些能力,这将是伟大的(至少有可能)获得不仅仅是一种语言从Android。

以Chrome为例,我可以添加多种语言,按我的个人喜好排列它们。我不知道在Android平台上的这种能力。

目前,我只是现场。getdefault(),但我更愿意用列表& lt工作;现场。LanguageRange & gt;(从java 8)来自浏览器通过接受语言。

  1. 我是否忽略了正确的Android API? If so, please repoint me.
  2. Android是否支持这一点? If not, why not? Is it planned?
answer1: 回答1:

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.

我是否忽略了正确的Android API?

不.

Android是否支持这一点?

不.

欢迎你来实现自己的多选择列表区域和要求用户额外的(超出他们的设备设置)他们要使用您的应用程序。用户没有手段,在设备级别,指定多个地区。

java  android  multilanguage  ietf-bcp-47