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.
我正在编写一个通过HTTP获取数据的Android应用程序。服务器端实现完全了解IETF BCP 47(包括RFC 4647)。它解析Accept-Language标头,并考虑优雅后备用户的语言偏好。
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.
为了利用这些功能,(至少有可能)从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.
例如,在Chrome中,我可以添加多种语言,并根据个人喜好对其进行排序。我不知道Android平台上的这种功能。
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
.
目前,我只是Locale.getDefault(),但我更喜欢使用来自浏览器的List
- Did I overlook the correct Android API? If so, please repoint me.
- Does Android even support that? If not, why not? Is it planned?
我忽略了正确的Android API吗?如果是这样,请指责我。
Android甚至支持吗?如果没有,为什么不呢?有计划吗?
1 个解决方案
#1
Did I overlook the correct Android API?
我忽略了正确的Android API吗?
No.
Does Android even support that?
Android甚至支持吗?
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.
您可以实现自己的多选语言环境列表,并询问用户他们想要在您的应用中使用哪些附加设置(超出设备设置)。用户无法在设备级别指定多个区域设置。
#1
Did I overlook the correct Android API?
我忽略了正确的Android API吗?
No.
Does Android even support that?
Android甚至支持吗?
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.
您可以实现自己的多选语言环境列表,并询问用户他们想要在您的应用中使用哪些附加设置(超出设备设置)。用户无法在设备级别指定多个区域设置。