summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-01-12 17:16:12 -0500
committerLinus Groh <mail@linusgroh.de>2022-01-13 13:43:57 +0100
commit0d759498276f64cd8f89111fe3314d6a8915ef99 (patch)
tree79bba7100e84250d56a7d690bb8b085e23d6c503 /Userland
parent7f162c471d14e6c298226f085ffb0fc8cfff8c22 (diff)
downloadserenity-0d759498276f64cd8f89111fe3314d6a8915ef99.zip
LibUnicode: Parse and generate locale display names for date fields
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibUnicode/Forward.h1
-rw-r--r--Userland/Libraries/LibUnicode/Locale.cpp4
-rw-r--r--Userland/Libraries/LibUnicode/Locale.h4
3 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibUnicode/Forward.h b/Userland/Libraries/LibUnicode/Forward.h
index de9640d741..0c2ea6ee01 100644
--- a/Userland/Libraries/LibUnicode/Forward.h
+++ b/Userland/Libraries/LibUnicode/Forward.h
@@ -18,6 +18,7 @@ enum class CalendarSymbol : u8;
enum class CompactNumberFormatType : u8;
enum class Condition : u8;
enum class Currency : u16;
+enum class DateField : u8;
enum class DayPeriod : u8;
enum class Era : u8;
enum class GeneralCategory : u8;
diff --git a/Userland/Libraries/LibUnicode/Locale.cpp b/Userland/Libraries/LibUnicode/Locale.cpp
index 9ed9420e2b..e0362979e8 100644
--- a/Userland/Libraries/LibUnicode/Locale.cpp
+++ b/Userland/Libraries/LibUnicode/Locale.cpp
@@ -747,6 +747,7 @@ Optional<Territory> __attribute__((weak)) territory_from_string(StringView) { re
Optional<ScriptTag> __attribute__((weak)) script_tag_from_string(StringView) { return {}; }
Optional<Currency> __attribute__((weak)) currency_from_string(StringView) { return {}; }
Optional<CalendarName> __attribute__((weak)) calendar_name_from_string(StringView) { return {}; }
+Optional<DateField> __attribute__((weak)) date_field_from_string(StringView) { return {}; }
Optional<Key> __attribute__((weak)) key_from_string(StringView) { return {}; }
Optional<ListPatternType> __attribute__((weak)) list_pattern_type_from_string(StringView) { return {}; }
Optional<ListPatternStyle> __attribute__((weak)) list_pattern_style_from_string(StringView) { return {}; }
@@ -758,6 +759,9 @@ Optional<StringView> __attribute__((weak)) get_locale_short_currency_mapping(Str
Optional<StringView> __attribute__((weak)) get_locale_narrow_currency_mapping(StringView, StringView) { return {}; }
Optional<StringView> __attribute__((weak)) get_locale_numeric_currency_mapping(StringView, StringView) { return {}; }
Optional<StringView> __attribute__((weak)) get_locale_calendar_mapping(StringView, StringView) { return {}; }
+Optional<StringView> __attribute__((weak)) get_locale_long_date_field_mapping(StringView, StringView) { return {}; }
+Optional<StringView> __attribute__((weak)) get_locale_short_date_field_mapping(StringView, StringView) { return {}; }
+Optional<StringView> __attribute__((weak)) get_locale_narrow_date_field_mapping(StringView, StringView) { return {}; }
Optional<StringView> get_locale_currency_mapping(StringView locale, StringView currency, Style style)
{
diff --git a/Userland/Libraries/LibUnicode/Locale.h b/Userland/Libraries/LibUnicode/Locale.h
index d410cf475e..a26aae8356 100644
--- a/Userland/Libraries/LibUnicode/Locale.h
+++ b/Userland/Libraries/LibUnicode/Locale.h
@@ -147,6 +147,7 @@ Optional<Territory> territory_from_string(StringView territory);
Optional<ScriptTag> script_tag_from_string(StringView script_tag);
Optional<Currency> currency_from_string(StringView currency);
Optional<CalendarName> calendar_name_from_string(StringView calendar);
+Optional<DateField> date_field_from_string(StringView calendar);
Optional<Key> key_from_string(StringView key);
Optional<ListPatternType> list_pattern_type_from_string(StringView list_pattern_type);
Optional<ListPatternStyle> list_pattern_style_from_string(StringView list_pattern_style);
@@ -160,6 +161,9 @@ Optional<StringView> get_locale_narrow_currency_mapping(StringView locale, Strin
Optional<StringView> get_locale_numeric_currency_mapping(StringView locale, StringView currency);
Optional<StringView> get_locale_currency_mapping(StringView locale, StringView currency, Style style);
Optional<StringView> get_locale_calendar_mapping(StringView locale, StringView calendar);
+Optional<StringView> get_locale_long_date_field_mapping(StringView locale, StringView date_field);
+Optional<StringView> get_locale_short_date_field_mapping(StringView locale, StringView date_field);
+Optional<StringView> get_locale_narrow_date_field_mapping(StringView locale, StringView date_field);
Optional<StringView> get_locale_key_mapping(StringView locale, StringView keyword);
Vector<StringView> get_locale_key_mapping_list(StringView locale, StringView keyword);