What is Locale class in Java? - Java Localization

What is Locale class in Java? Explain the methods offered by Locale class.

The class Locale represents a specific political, geographical or cultural region. The operations that uses Locale is known as ‘locale-sensitive’ for tailoring the information for the user.

The following are the methods in Locale class:

1. getAvailableLocales();
This method returns a list of all installed locales.

2. getISOCountries():
This method returns a list which contains 2-letter country codes that isdefined in ISO 3166.

3. getISOLanguages():
This method returns a list that contains 2-letter code that is defined in ISO 639.

4. getLanguage():
This method returns a code that represents a language of a specific locale available in ISO 639 code.

5. getCountry():
This method returns the country or region for this locale available in the ISO 3166 code.

6. getDisplayLanguage():
This method returns the name of the locale’s language. If the locale returns fr_FR, it represents ‘French’.

7. getDisplayCountry():
This method returns the name of the locale’s country. If the locale returns fr_FR, it represents ‘France’.
What is resource bundles? and usage - Java Localization
A resource bundle is file that has ‘.properties’ extension in Java. It contains the data that is locale specific...
How java localizer works with Resource Bundles - Java Localization
Localizer is the most popular way for localizing a Java application. The localizable information is persisted in “ .properties “ files. The localizer ‘Lingobit’ translates the required files into another language...
How to extract strings to Resource Bundle files - Java Localization
Strings can extract to a Resource Bundle file by using the method getString()...
Post your comment