Saturday, October 6, 2012

What Is a Locale ? (JAVA)

Courtesy:  JAVA Internationalization
                  - Andrew Deitsch & David Czarnecki

In software internationalization, we use the term locale when we talk about local markets. A locale embraces a specific language in combination with a given cultural, geographical and political region. A French Canadian locale refers to the French Speaking part of Canada (Quebec Province), and is associated with the language and information such as the date, currency, and number formats for that particular region. A different local would be used for the English speaking part of Canada. In addition to the language and formatting information, important data that you might not immediately associate with a locale is usually included, such as:


  • Names of the months
  • Days of the week
  • The first day of the week
  • Collation sequencing (sort order)
  • Time zone information
In JAVA, locale information is maintained in the java.util.Locale object and represents:


  • A language
  • A country or region 
  • An optional variant

 Working with the Locale Class :

The Locale class in Java is easy to use. It is meant to be an identification class that is ultimately used by other classes performing locale-sensitive operation.