mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 04:27:12 +02:00
LibUnicode: Do not generate data for "generic" calendars
This is not a calendar supported by ECMA-402, so let's not waste space with its data. Further, don't generate "gregorian" as a valid Unicode locale extension keyword. It's an invalid type identifier, thus cannot be used in locales such as "en-u-ca-gregorian".
This commit is contained in:
committed by
Linus Groh
parent
f02ecc1da2
commit
bf79c73158
Notes:
sideshowbarker
2024-07-17 23:15:28 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/bf79c731583 Pull-request: https://github.com/SerenityOS/serenity/pull/11149 Reviewed-by: https://github.com/linusg ✅
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user