Common Locale Data Repository

Java 11 implements the decision to use locale data from the Unicode Common Locale Data Repository by default. CLDR is a key component of many software applications that support multiple languages. It is touted as the largest locale data repository and is used by a plethora of large software providers, including Apple, Google, IBM, and Microsoft. The widespread use of CLDR has made it the unofficial industry standard repository for locale data. Making this the default repository in the current Java platform further solidifies it as the software industry standard.

Interestingly, CLDR was already part of JDK 8, but was not the default library. In Java 8, we had to enable CLDR by setting a system property, as shown here:

java.locale.providers=JRE,CLDR

Now, in Java, we no longer have to enable CLDR, as it will be the default repository. 

There are additional locale data repositories in the current Java platform. They are listed here in their default lookup order:

  • CLDR
  • COMPAT (previously JRE)
  • Service Provider Interface (SPI)

To change the lookup order, we can change the java.locale.providers setting as illustrated:

java.locale.providers=SPI,COMPAT,CLDR

In the preceding example, SPI would be first, followed by COMPAT, and then CLDR.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset