如何为阿拉伯语添加语言环境 [英] How to add locale for Arabic
本文介绍了如何为阿拉伯语添加语言环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图使用本教程使用JSF 2.0构建多语言网站
但是我正面临着这一行
countries.put("English", Locale.ENGLISH);
countries.put("Chinese", Locale.SIMPLIFIED_CHINESE);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
我想将其表示为Arabic
,但Locale.XXXXXXX
并未为阿拉伯国家提供任何支持.我得到的是一些国家,但没有阿拉伯国家.
I want to put it as Arabic
, but Locale.XXXXXXX
is not giving any support for Arab countries. What I get is some countries but NO Arabic country.
任何想法,要怎么做才能拥有阿拉伯国家?
Any idea, what to do so that I can have arabic country?
推荐答案
您必须使用此
countries.put("Arabic", new Locale("ar", "DZ"));
//or just language name for generic Arabic
new Locale("ar");
第一对字母表示语言,第二对字母表示国家(地区)-在这种情况下为阿尔及利亚.您可以使用此链接作为可用国家/地区列表的参考和语言环境(我知道,Rosindia很烂,但是在我看来,这个列表非常有用).
Where the first pair of letters means language and the second is country (region) - Algeria in this case. You can use this link as a reference for the list of available countries and locales (I know, Roseindia sucks but this list seemed to me very useful).
这篇关于如何为阿拉伯语添加语言环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文