检测设备上可用的区域设置
我正在我的应用程序中实现覆盖设备的区域设置,允许通过首选项选择不同的语言。
现在,在显示可用语言列表时,我正在使用 Locale.getAvailableLocales() 来查看设备上安装了哪些语言。
如果没有完整安装所需的字体等,这会起作用吗?例如,仅返回较小的区域设置集?
I am implementing overriding the locale of the device in my application allowing the selection of a different language via a preference.
Now when presenting the list of available languages I am looking at using Locale.getAvailableLocales() to see which ones are installed on the device.
Will that work and e.g. only return a smaller set of locales if they are not fulled installed down to the needed fonts and so on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如Android 文档所述:
对我来说,这意味着您应该针对这些方法进行测试以确保安全。所以看来答案是否定的。然而,就安装的字体而言,我相信系统提供了一种显示几乎任何语言的方法。一些符号字形可能会丢失,但我不认为它涉及常规字符(或者可能涉及一些晦涩的脚本,但我认为您不会使用它们)。
As Android's Documentation states:
To me that means you should test against these methods to be on the safe side. So it seems that the answer is no. However, in terms of installed fonts, I believe that system provides a way to display almost any language. Some symbolic glyphs might be missing but I don't think it regards to regular characters (or maybe it does in regards to some obscure scripts but I don't think you would use them).