Fahim Parkar
Fahim Parkar

Reputation: 31627

How to add locale for Arabic

I was trying to build multi-language website using JSF 2.0 using this tutorial

But I am facing at this line

countries.put("English", Locale.ENGLISH);
countries.put("Chinese", Locale.SIMPLIFIED_CHINESE);
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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?

Upvotes: 6

Views: 19326

Answers (1)

Petr Mensik
Petr Mensik

Reputation: 27496

You have to use this

countries.put("Arabic", new Locale("ar", "DZ"));
//or just language name for generic Arabic
new Locale("ar"); 

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).

Upvotes: 22

Related Questions