<i18n dev> Integrated: 8329691: Support `nonlikelyScript` parent locale inheritance

Naoto Sato naoto at openjdk.org
Thu May 9 15:56:59 UTC 2024


On Mon, 6 May 2024 17:53:56 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> This PR is to implement the `nonlikelyScript` feature that went into CLDR version 45 for migration purposes. In its release note, it states (https://cldr.unicode.org/index/downloads/cldr-45):
> 
> Migration
> Changes to parentLocales require upgrading implementations that use that element. In particular, they need to support the new nonlikelyScript value, and use the appropriate explicit inheritance for each type of inheritance. The v44 list of locales that inherit directly from root is retained for this release, but will disappear in the future. So implementations should move as quickly as possible to support the new value
> 
> For example in `Russian` locales fallback, its likely script is `Cyrl` (Cyrillic). Thus Russian locales with non-likely script, such as 'ru-Latn' (Russian in Latin script) should fallback directly to `root`, bypassing `ru` (Russian). CLDR has explicit parent locales for this nonlikely scripts, such as `zh-Hant` -> `root` already, but the release note suggests this will go away, and JDK needs to logically handle these non-likely script inheritance cases.
> 
> To implement this behavior, CLDRConverter build tool now generates the `LocaleDataMetaInfo` for java.base module with the new `likelyScriptMap`, which maps the script to its likely languages. Since the map is big, it is lazily initialized when needed. The map is used at runtime to determine the parent locale fallback based on implicit/explicit nonlikely Script inheritance.

This pull request has now been integrated.

Changeset: c7d98df2
Author:    Naoto Sato <naoto at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/c7d98df2ac509ebc8f4e801a0874a9497c54c602
Stats:     287 lines in 5 files changed: 211 ins; 31 del; 45 mod

8329691: Support `nonlikelyScript` parent locale inheritance

Reviewed-by: joehw

-------------

PR: https://git.openjdk.org/jdk/pull/19108


More information about the i18n-dev mailing list