for (int i=0; i
String language = locales[i].getLanguage();
// Get the 2-letter country code; may be equal to ""
String country = locales[i].getCountry();
// Get localized name suitable for display to the user
String locName = locales[i].getDisplayName();
}
Here's a sample of output using a default locale of Locale.ENGLISH:
Language Code, Country Code, Localized Name
ar, , Arabic
ar, AE, Arabic (United Arab Emirates)
ar, BH, Arabic (Bahrain)
ar, DZ, Arabic (Algeria)
ar, EG, Arabic (Egypt)
ar, IQ, Arabic (Iraq)
ar, JO, Arabic (Jordan)
ar, KW, Arabic (Kuwait)
ar, LB, Arabic (Lebanon)
Here's a sample of output using a default locale of Locale.FRENCH:
Language Code, Country Code, Localized Name
ar, , arabe
ar, AE, arabe (Emirats Arabes Unis)
ar, EG, arabe (Egypte)
ar, IQ, arabe (Irak)
ar, JO, arabe (Jordanie)
ar, KW, arabe (Koweit)
ar, LB, arabe (Liban)
No comments:
Post a Comment