indrayam / locale-deep-dive

Diving into the nuances of setting up Locale

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Locale

Instantiate Locale

  • new Locale(String language)
  • new Locale(String language, String country)
  • new Locale.Builder().setLanguage("en").setRegion("US").build();

Set Default Locale

  • Locale.setDefault(localVar)
    • Locale.setDefault(Locale.FORMAT, localVar)
    • Locale.setDefault(Locale.DISPLAY, localVar)

Standardized Language Code

ISO 639-1 (alpha-2) or ISO 639-2 (alpha-3) language code (2 or 3 digit). Seems like the 639-1 language code works better.

Standardized Country Code

ISO 3166 alpha-2 country code OR 3 digit UN M.49 Area Code

About

Diving into the nuances of setting up Locale


Languages

Language:Java 100.0%