Home  >  Article  >  Java  >  What is Common Locale Data Repository (CLDR) in Java 9?

What is Common Locale Data Repository (CLDR) in Java 9?

WBOY
WBOYforward
2023-09-14 08:29:14690browse

在Java 9中,Common Locale Data Repository(CLDR)是什么?

Internationalization for Java 9 Enhancements include default enabledCLDRlocale data . p>

There are four different sources of locale data identified using the following keywords:

  • CLDR: By the Unicode Common Locale Data Repository (CLDR) project.
  • HOST: The current user’s customization of the underlying operating system settings. Depending on the operating system, formats such as date, time, numeric, and currency are supported.
  • SPI: Locale-sensitive service implemented in the installed SPI provider.
  • COMPAT (JRE): Locale data compatible with versions prior to Java 9. JRE can still be used as a value, but is deprecated and will be removed in the future.

In Java 8 and earlier versions, JRE is the default locale data. Java 9 sets CLDR to the highest priority by default. We use the java.locale.providers system properties to select the locale data sources in order of preference. If a provider fails to request locale data, the next provider can be processed.

<strong>java.locale.providers=COMPAT,CLDR,HOST,SPI</strong>

If we don’t set this property, the default behavior is:

<strong>java.locale.providers=CLDR,COMPAT,SPI
</strong>

For Compatible with Java 8, keep COMPAT before CLDR.

<strong>java.locale.providers=COMPAT,CLDR</strong>

The above is the detailed content of What is Common Locale Data Repository (CLDR) in Java 9?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete