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

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

WBOY
Release: 2023-09-14 08:29:14
forward
724 people have browsed it

在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>
Copy after login

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

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

For Compatible with Java 8, keep COMPAT before CLDR.

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

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template