diff options
Diffstat (limited to 'Meta')
-rw-r--r-- | Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp | 5 | ||||
-rw-r--r-- | Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeLocale.cpp | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp index 89ed709092..607993d790 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp @@ -151,6 +151,11 @@ static ErrorOr<void> parse_calendars(String locale_calendars_path, UnicodeLocale }; calendars_object.as_object().for_each_member([&](auto const& calendar_name, JsonValue const& value) { + // The generic calendar is not a supported Unicode calendar key, so skip it: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar#unicode_calendar_keys + if (calendar_name == "generic"sv) + return; + auto& calendar = ensure_calendar(calendar_name); if (!locale_data.calendars.contains_slow(calendar_name)) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeLocale.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeLocale.cpp index c669cdf7c6..3f0e2d018a 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeLocale.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeLocale.cpp @@ -407,12 +407,17 @@ static ErrorOr<void> parse_calendar_keywords(String locale_dates_path, UnicodeLo auto const& calendars_object = dates_object.as_object().get("calendars"sv); calendars_object.as_object().for_each_member([&](auto const& calendar_name, JsonValue const&) { - keyword_values.append(calendar_name); + // The generic calendar is not a supported Unicode calendar key, so skip it: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar#unicode_calendar_keys + if (calendar_name == "generic"sv) + return; // FIXME: Similar to the calendar aliases defined in GenerateUnicodeDateTimeFormat, this // should be parsed from BCP47. https://unicode-org.atlassian.net/browse/CLDR-15158 if (calendar_name == "gregorian"sv) keyword_values.append("gregory"sv); + else + keyword_values.append(calendar_name); }); } |