JAVA Internalization Tutorial
Selected Reading
- Java I18N - Discussion
- Java I18N - Useful Resources
- Java I18N - Quick Guide
- JAVA I18N - From Reader and To Writer Conversion
- JAVA I18N - From and To String Conversion
- JAVA I18N - UTC
- JAVA I18N - Date Format Patterns
- JAVA I18N - DateFormatSymbols Class
- JAVA I18N - Formatting Date
- JAVA I18N - SimpleDateFormat Class
- JAVA I18N - Formatting Date and Time
- JAVA I18N - Formatting Time
- JAVA I18N - Formatting Dates
- JAVA I18N - DateFormat Class
- JAVA I18N - Grouping Digits
- JAVA I18N - DecimalFormatSymbols Class
- JAVA I18N - Locale Specific DecimalFormat
- JAVA I18N - Formatting Patterns
- JAVA I18N - DecimalFormat Class
- JAVA I18N - Parsing Numbers
- JAVA I18N - Set Rounding Mode
- JAVA I18N - Set Min/Max Precision
- JAVA I18N - Format Percentages
- JAVA I18N - Format Currencies
- JAVA I18N - NumberFormat Class
- JAVA I18N - ResourceBundle Class
- JAVA I18N - Display Language
- JAVA I18N - Locale Details
- JAVA I18N - Locale Class
- JAVA I18N - Environment Setup
- JAVA I18N - Overview
- JAVA I18N - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
JAVA I18N - Locale Details
Java Internapzation - Locale Details
In this example, we ll get default locale and print its details. Then create a locale for "fr" and print its details.
I18NTester.java
import java.util.Locale; pubpc class I18NTester { pubpc static void main(String[] args) { Locale locale =Locale.getDefault(); System.out.println("Default Locale Properties: "); System.out.println(locale.getDisplayCountry()); System.out.println(locale.getDisplayLanguage()); System.out.println(locale.getDisplayName()); System.out.println(locale.getISO3Country()); System.out.println(locale.getISO3Language()); System.out.println(locale.getLanguage()); System.out.println(locale.getCountry()); Locale frenchLocale = new Locale("fr","fr"); System.out.println(" fr Locale Properties: "); System.out.println(frenchLocale.getDisplayCountry()); System.out.println(frenchLocale.getDisplayLanguage()); System.out.println(frenchLocale.getDisplayName()); System.out.println(frenchLocale.getISO3Country()); System.out.println(frenchLocale.getISO3Language()); System.out.println(frenchLocale.getLanguage()); System.out.println(frenchLocale.getCountry()); } }
Output
It will print the following result.
Default Locale Properties: United States Engpsh Engpsh (United States) USA eng en US fr Locale Properties: France French French (France) FRA fra fr FR