Java code to list all the available Locales
While implementing Internationalization (I18N) concept, there will be a requirement to find the Locales.Check the following java code to list all the available Locales
Locale[] locales = Locale.getAvailableLocales();
for (int i=0; i
// Get the two letter language code
String language = locales[i].getLanguage();
// Get the two letter country code;
String country = locales[i].getCountry();
// Get localized name suitable for display
String locName = locales[i].getDisplayName();
}
0 comments:
Post a Comment