1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 08:47:35 +00:00

LibUnicode: Parse and generate CLDR unit data for Intl.NumberFormat

The units data is in another CLDR package, cldr-units.
This commit is contained in:
Timothy Flynn 2021-11-16 09:31:15 -05:00 committed by Linus Groh
parent 80493908d3
commit cafb717486
5 changed files with 228 additions and 4 deletions

View file

@ -20,6 +20,7 @@ enum class Locale : u16;
enum class Property : u8;
enum class Script : u8;
enum class StandardNumberFormatType : u8;
enum class Style : u8;
enum class Territory : u8;
enum class WordBreakProperty : u8;

View file

@ -851,6 +851,15 @@ Optional<NumberFormat> get_standard_number_system_format([[maybe_unused]] String
#endif
}
Vector<NumberFormat> get_unit_formats([[maybe_unused]] StringView locale, [[maybe_unused]] StringView unit, [[maybe_unused]] Style style)
{
#if ENABLE_UNICODE_DATA
return Detail::get_unit_formats(locale, unit, style);
#else
return {};
#endif
}
Optional<ListPatterns> get_locale_list_patterns([[maybe_unused]] StringView locale, [[maybe_unused]] StringView type, [[maybe_unused]] StringView style)
{
#if ENABLE_UNICODE_DATA

View file

@ -191,6 +191,7 @@ Optional<StringView> get_number_system_symbol(StringView locale, StringView syst
Optional<NumberGroupings> get_number_system_groupings(StringView locale, StringView system);
Optional<NumberFormat> get_standard_number_system_format(StringView locale, StringView system, StandardNumberFormatType type);
Vector<NumberFormat> get_compact_number_system_formats(StringView locale, StringView system, CompactNumberFormatType type);
Vector<NumberFormat> get_unit_formats(StringView locale, StringView unit, Style style);
Optional<ListPatterns> get_locale_list_patterns(StringView locale, StringView type, StringView style);
Optional<StringView> resolve_language_alias(StringView language);