diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp index 16d169ce28..8633841cea 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp @@ -65,13 +65,13 @@ JS_DEFINE_NATIVE_FUNCTION(DisplayNamesPrototype::of) case DisplayNames::Type::Currency: switch (display_names->style()) { case DisplayNames::Style::Long: - result = Unicode::get_locale_currency_mapping(display_names->locale(), code.as_string().string(), Unicode::Style::Long); + result = Unicode::get_locale_long_currency_mapping(display_names->locale(), code.as_string().string()); break; case DisplayNames::Style::Short: - result = Unicode::get_locale_currency_mapping(display_names->locale(), code.as_string().string(), Unicode::Style::Short); + result = Unicode::get_locale_short_currency_mapping(display_names->locale(), code.as_string().string()); break; case DisplayNames::Style::Narrow: - result = Unicode::get_locale_currency_mapping(display_names->locale(), code.as_string().string(), Unicode::Style::Narrow); + result = Unicode::get_locale_narrow_currency_mapping(display_names->locale(), code.as_string().string()); break; default: VERIFY_NOT_REACHED(); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp index a1f5b3cc1f..046fb92cca 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Tim Flynn + * Copyright (c) 2021-2022, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ @@ -85,13 +85,13 @@ StringView NumberFormat::resolve_currency_display() m_resolved_currency_display = currency(); break; case NumberFormat::CurrencyDisplay::Symbol: - m_resolved_currency_display = Unicode::get_locale_currency_mapping(data_locale(), currency(), Unicode::Style::Short); + m_resolved_currency_display = Unicode::get_locale_short_currency_mapping(data_locale(), currency()); break; case NumberFormat::CurrencyDisplay::NarrowSymbol: - m_resolved_currency_display = Unicode::get_locale_currency_mapping(data_locale(), currency(), Unicode::Style::Narrow); + m_resolved_currency_display = Unicode::get_locale_narrow_currency_mapping(data_locale(), currency()); break; case NumberFormat::CurrencyDisplay::Name: - m_resolved_currency_display = Unicode::get_locale_currency_mapping(data_locale(), currency(), Unicode::Style::Numeric); + m_resolved_currency_display = Unicode::get_locale_numeric_currency_mapping(data_locale(), currency()); break; default: VERIFY_NOT_REACHED(); diff --git a/Userland/Libraries/LibUnicode/Locale.cpp b/Userland/Libraries/LibUnicode/Locale.cpp index e0362979e8..a315a2db7b 100644 --- a/Userland/Libraries/LibUnicode/Locale.cpp +++ b/Userland/Libraries/LibUnicode/Locale.cpp @@ -762,23 +762,6 @@ Optional __attribute__((weak)) get_locale_calendar_mapping(StringVie Optional __attribute__((weak)) get_locale_long_date_field_mapping(StringView, StringView) { return {}; } Optional __attribute__((weak)) get_locale_short_date_field_mapping(StringView, StringView) { return {}; } Optional __attribute__((weak)) get_locale_narrow_date_field_mapping(StringView, StringView) { return {}; } - -Optional get_locale_currency_mapping(StringView locale, StringView currency, Style style) -{ - switch (style) { - case Style::Long: - return get_locale_long_currency_mapping(locale, currency); - case Style::Short: - return get_locale_short_currency_mapping(locale, currency); - case Style::Narrow: - return get_locale_narrow_currency_mapping(locale, currency); - case Style::Numeric: - return get_locale_numeric_currency_mapping(locale, currency); - default: - VERIFY_NOT_REACHED(); - } -} - Optional __attribute__((weak)) get_locale_key_mapping(StringView, StringView) { return {}; } Vector get_locale_key_mapping_list(StringView locale, StringView keyword) diff --git a/Userland/Libraries/LibUnicode/Locale.h b/Userland/Libraries/LibUnicode/Locale.h index a26aae8356..e6d7647f4e 100644 --- a/Userland/Libraries/LibUnicode/Locale.h +++ b/Userland/Libraries/LibUnicode/Locale.h @@ -159,7 +159,6 @@ Optional get_locale_long_currency_mapping(StringView locale, StringV Optional get_locale_short_currency_mapping(StringView locale, StringView currency); Optional get_locale_narrow_currency_mapping(StringView locale, StringView currency); Optional get_locale_numeric_currency_mapping(StringView locale, StringView currency); -Optional get_locale_currency_mapping(StringView locale, StringView currency, Style style); Optional get_locale_calendar_mapping(StringView locale, StringView calendar); Optional get_locale_long_date_field_mapping(StringView locale, StringView date_field); Optional get_locale_short_date_field_mapping(StringView locale, StringView date_field);