1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:05:06 +00:00

LibUnicode: Parse and generate regional hour cycles

Unlike most data in the CLDR, hour cycles are not stored on a per-locale
basis. Instead, they are keyed by a string that is usually a region, but
sometimes is a locale. Therefore, given a locale, to determine the hour
cycles for that locale, we:

    1. Check if the locale itself is assigned hour cycles.
    2. If the locale has a region, check if that region is assigned hour
       cycles.
    3. Otherwise, maximize that locale, and if the maximized locale has
       a region, check if that region is assigned hour cycles.
    4. If the above all fail, fallback to the "001" region.

Further, each locale's default hour cycle is the first assigned hour
cycle.
This commit is contained in:
Timothy Flynn 2021-11-27 20:57:21 -05:00 committed by Linus Groh
parent 15fc03ef34
commit 48ce72e472
5 changed files with 183 additions and 7 deletions

View file

@ -191,7 +191,7 @@ if (ENABLE_UNICODE_DATABASE_DOWNLOAD)
Lagom::GenerateUnicodeDateTimeFormat
"${UNICODE_DATE_TIME_FORMAT_HEADER}"
"${UNICODE_DATE_TIME_FORMAT_IMPLEMENTATION}"
arguments -d "${CLDR_DATES_PATH}"
arguments -r "${CLDR_CORE_PATH}" -d "${CLDR_DATES_PATH}"
)
invoke_generator(
"UnicodeLocale"