- JAVA Internalization Tutorial
- JAVA I18N - Home
- JAVA I18N - Overview
- JAVA I18N - Environment Setup
- Locale Class Examples
- JAVA I18N - Locale Class
- JAVA I18N - Locale Details
- JAVA I18N - Display Language
- ResourceBundle Class Examples
- JAVA I18N - ResourceBundle Class
- NumberFormat Class Examples
- JAVA I18N - NumberFormat Class
- JAVA I18N - Format Currencies
- JAVA I18N - Format Percentages
- JAVA I18N - Set Min/Max Precision
- JAVA I18N - Set Rounding Mode
- JAVA I18N - Parsing Numbers
- DecimalFormat Class Examples
- JAVA I18N - DecimalFormat Class
- JAVA I18N - Formatting Patterns
- JAVA I18N - Locale Specific DecimalFormat
- JAVA I18N - DecimalFormatSymbols Class
- JAVA I18N - Grouping Digits
- DateFormat Class Examples
- JAVA I18N - DateFormat Class
- JAVA I18N - Formatting Dates
- JAVA I18N - Formatting Time
- JAVA I18N - Formatting Date and Time
- SimpleDateFormat Class Examples
- JAVA I18N - SimpleDateFormat Class
- JAVA I18N - Formatting Date
- JAVA I18N - DateFormatSymbols Class
- JAVA I18N - Date Format Patterns
- Time Zones Examples
- JAVA I18N - UTC
- Unicode Conversion
- JAVA I18N - From and To String Conversion
- JAVA I18N - From Reader and To Writer Conversion
- JAVA Internalization Useful Resources
- Java I18N - Quick Guide
- Java I18N - Useful Resources
- Java I18N - Discussion
Java Internalization - Locale Class
A Locale class object represents a specific geographical/political/cultural region. Any operation requiring a Locale to perform its task is called locale-sensitive operation and uses the Locale to master information relative to the user. For example, displaying a number is a locale-sensitive operation. The number should be formatted as per the customs and conventions of the user's native country, region, or culture.
Locale Contents
A Locale object contains the following:
Language - ISO 639 alpha-2 or alpha-3 language code, or registered language subtags up to 8 alpha letters. alpha-2 code must be used if both alpha-2 and alpha-3 code are present. The language field is case insensitive, but Locale always canonicalizes to lower case.
Script - ISO 15924 alpha-4 script code. The script field is case insensitive, but Locale always canonicalizes to title case.
Country (region) - ISO 3166 alpha-2 country code or UN M.49 numeric-3 area code. The country field is case insensitive, but Locale always canonicalizes to upper case.
Variant - Any arbitrary value used to indicate a variation of a Locale. Where there are two or more variant values each indicating its own semantics, these values should be ordered by importance, with most important first, separated by underscore('_'). The variant field is case sensitive.
Extensions - A map from single character keys to string values, indicating extensions apart from language identification. The extensions in Locale implement the semantics and syntax of BCP 47 extension subtags and private use subtags. The extensions are case insensitive, but Locale canonicalizes all extension keys and values to lower case.