1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

LibUnicode: Generate per-region week data

This includes:
* The minimum number of days in a week for that week to count as the
  first week of a new year.
* The day to be shown as the first day of the week in a calendar.
* The start/end days of the weekend.

Like the existing hour cycle data, week data is presented per-region in
the CLDR, rather than per-locale. The method to add likely subtags to a
locale to perform region lookups is the same.

The list of regions in the CLDR for hour cycle, minimum days, first day,
and weekend days are quite different. So rather than changing the
existing HourCycleRegion enum to a generic Region enum, we generate
separate enums for each of the week data fields. This allows each lookup
into these fields to remain simple array-based index access, without any
"jumps" for regions that don't have CLDR data for a field.
This commit is contained in:
Timothy Flynn 2022-07-06 08:21:32 -04:00 committed by Linus Groh
parent 88a560dd84
commit 12e7c0808a
4 changed files with 192 additions and 10 deletions

View file

@ -21,6 +21,7 @@ enum class Currency : u16;
enum class DateField : u8;
enum class DayPeriod : u8;
enum class Era : u8;
enum class FirstDayRegion : u8;
enum class GeneralCategory : u8;
enum class GraphemeBreakProperty : u8;
enum class HourCycle : u8;
@ -34,6 +35,7 @@ enum class Language : u16;
enum class ListPatternStyle : u8;
enum class ListPatternType : u8;
enum class Locale : u16;
enum class MinimumDaysRegion : u8;
enum class Month : u8;
enum class NumericSymbol : u8;
enum class Property : u8;
@ -44,6 +46,8 @@ enum class StandardNumberFormatType : u8;
enum class Style : u8;
enum class Territory : u8;
enum class Weekday : u8;
enum class WeekendEndRegion : u8;
enum class WeekendStartRegion : u8;
enum class WordBreakProperty : u8;
struct CalendarFormat;