Android 本地化安卓
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3615587/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Localization Android
提问by SoftReference
What languages are supported by android for localization with their respective values folder name, the best link i could find was http://developer.android.com/reference/java/util/Locale.html
android 支持哪些语言进行本地化及其各自的值文件夹名称,我能找到的最佳链接是http://developer.android.com/reference/java/util/Locale.html
any body can help me with more languages what if we need to support more languages then listed above.
如果我们需要支持更多的语言,那么任何机构都可以帮助我使用更多语言。
回答by Nicolas Raoul
My app uses the following undocumented languages, and they work:
我的应用程序使用以下未记录的语言,它们可以工作:
- ca Catalan
- el Greek
- es Spanish
- pl Polish
- pt Portuguese
- ro Romanian
- ru Russian
- sv Swedish
- 加泰罗尼亚语
- el 希腊语
- es 西班牙语
- 波兰语
- pt 葡萄牙语
- ro 罗马尼亚语
- ru 俄语
- sv 瑞典语
More generally, it should be the string in the "639-1" column of this table.
更一般地说,它应该是这个表的“639-1”列中的字符串。
回答by Fernando Miguélez
Virtually any language defined by the Strings representing the language code (as specified by ISO 639-1) and (optionally) country (as defined by Alpha 2 representation of ISO 3166-1). You can specify only the language (i.e. "en") or the language used specifically in one area (i.e. "en","US"). You do not need to use the constants (though convenient) that come with Locale.
实际上,由代表语言代码(由 ISO 639-1 指定)和(可选)国家(由ISO 3166-1的Alpha 2 表示定义)的字符串定义的任何语言。您可以仅指定语言(即“en”)或特定地区使用的语言(即“en”、“US”)。您不需要使用 Locale 附带的常量(尽管很方便)。
// This is to get spanish locale of Spain
Locale spanish = new Locale("es", "ES");
The problem is not only specifying the correct languages, but also assuring that the mobile phone supports literals/formatting for the indicated Locale. I.e. a mobile phone sold in Spain will support "es" and "es_ES", almost surely "en" and "en_US" too and probably "ca_ES", "ba_ES" and "gl_ES". It is not likely that it will support for example "es_AR" or "zh_CN". So I think that the answer to your question is "it depends on the market of your application".
问题不仅在于指定正确的语言,还在于确保移动电话支持指定语言环境的文字/格式。即在西班牙销售的手机将支持“es”和“es_ES”,几乎肯定也支持“en”和“en_US”,可能还有“ca_ES”、“ba_ES”和“gl_ES”。它不太可能支持例如“es_AR”或“zh_CN”。所以我认为你的问题的答案是“这取决于你的应用程序的市场”。