The i18n Cookbook - recipies for a global society

  • java cookbook
  • about the author
Home › Java Internationalization Cookbook

Java Cookbook

  • Java Internationalization Cookbook
    • Locales
      • How to make a Locale object using language and country arguments
      • How to use a static constant to retrieve a common locale
      • How to get an array of available lLocales
      • Get all ISO language and country codes
      • Get localized display names
      • Create an ICU4J ULocale
    • Dates and Times
    • Numerical Systems
    • Misc
    • Resource Bundles
    • Unicode, Transliteration, and Charactersets

Locales

The concept of the locale is central to internationalization. It is the foundation for all other aspects of software internationalization.  At its most basic a locale represents the language of a user.  This is handled by combining a language and country code.
 
Java uses ISO 639 codes for languages and ISO 3166-2 codes for country.  ICU4J combines the two codes with a potential script name and appends additional data to the end after an '@'.  That additional data could refer to a calendar type or collation order, etc...
 
For example:
zh = Chinese
zh_HK = Chinese in Hong Kong
zh_Hans_HK = Chinese in Hong Kong using Simplified Han writing system
zh_Hans_HK@calendar=buddhist = Chinese in Hong Kong using a Simplifies Han writing system and using a Buddhist calendar
 

  • How to make a Locale object using language and country arguments
  • How to use a static constant to retrieve a common locale
  • How to get an array of available lLocales
  • Get all ISO language and country codes
  • Get localized display names
  • Create an ICU4J ULocale
‹ Java Internationalization Cookbook up How to make a Locale object using language and country arguments ›
  • icu4j
  • iso 3166
  • iso 639
  • Java
  • Locale
  • Printer-friendly version
  • Add new comment

If you are testing any of these recipes in Eclipse and the characters are not displaying correctly in your console visit http://i18ncookbook.com/eclipse_settings.

This site is ad supported.  I hope you find something among our sponsors worth clicking. ;)

i18n search

Google
Custom Search

Search

Tags in Tags

calendar date icu4j Java Locale number format numberformat parse spellout timezone transliteration transliterator
more tags

User login

  • Create new account
  • Request new password
  • java cookbook
  • about the author