diff --git a/intl/components/gtest/TestNumberFormat.cpp b/intl/components/gtest/TestNumberFormat.cpp index cb057c45e327..661da409e58e 100644 --- a/intl/components/gtest/TestNumberFormat.cpp +++ b/intl/components/gtest/TestNumberFormat.cpp @@ -96,8 +96,8 @@ TEST(IntlNumberFormat, SignificantDigits) TEST(IntlNumberFormat, Currency) { NumberFormatOptions options; - options.mCurrency = Some( - std::make_pair("MXN", NumberFormatOptions::CurrencyDisplayStyle::Symbol)); + options.mCurrency = + Some(std::make_pair("MXN", NumberFormatOptions::CurrencyDisplay::Symbol)); NumberFormat nf("es-MX", options); Buffer buf8; ASSERT_TRUE(nf.format(123456.789, buf8).isOk()); diff --git a/intl/components/src/NumberFormat.h b/intl/components/src/NumberFormat.h index 1e71426ebc24..31dc31d1a60e 100644 --- a/intl/components/src/NumberFormat.h +++ b/intl/components/src/NumberFormat.h @@ -42,13 +42,13 @@ struct MOZ_STACK_CLASS NumberFormatOptions { * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#unit * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#unit-width */ - enum class CurrencyDisplayStyle { + enum class CurrencyDisplay { Symbol, Code, Name, NarrowSymbol, }; - Maybe> mCurrency; + Maybe> mCurrency; /** * Set the fraction digits settings. |min| can be zero, |max| must be diff --git a/intl/components/src/NumberFormatterSkeleton.cpp b/intl/components/src/NumberFormatterSkeleton.cpp index cb78d462953e..37be858f1f63 100644 --- a/intl/components/src/NumberFormatterSkeleton.cpp +++ b/intl/components/src/NumberFormatterSkeleton.cpp @@ -82,19 +82,19 @@ bool NumberFormatterSkeleton::currency(std::string_view currency) { } bool NumberFormatterSkeleton::currencyDisplay( - NumberFormatOptions::CurrencyDisplayStyle display) { + NumberFormatOptions::CurrencyDisplay display) { switch (display) { - case NumberFormatOptions::CurrencyDisplayStyle::Code: + case NumberFormatOptions::CurrencyDisplay::Code: return appendToken(u"unit-width-iso-code"); break; - case NumberFormatOptions::CurrencyDisplayStyle::Name: + case NumberFormatOptions::CurrencyDisplay::Name: return appendToken(u"unit-width-full-name"); break; - case NumberFormatOptions::CurrencyDisplayStyle::Symbol: + case NumberFormatOptions::CurrencyDisplay::Symbol: // Default, no additional tokens needed. return true; break; - case NumberFormatOptions::CurrencyDisplayStyle::NarrowSymbol: + case NumberFormatOptions::CurrencyDisplay::NarrowSymbol: return appendToken(u"unit-width-narrow"); break; default: diff --git a/intl/components/src/NumberFormatterSkeleton.h b/intl/components/src/NumberFormatterSkeleton.h index a71c227345aa..643acaf16b10 100644 --- a/intl/components/src/NumberFormatterSkeleton.h +++ b/intl/components/src/NumberFormatterSkeleton.h @@ -59,7 +59,7 @@ class MOZ_STACK_CLASS NumberFormatterSkeleton final { bool currency(std::string_view currency); - bool currencyDisplay(NumberFormatOptions::CurrencyDisplayStyle display); + bool currencyDisplay(NumberFormatOptions::CurrencyDisplay display); bool unit(std::string_view unit); diff --git a/intl/l10n/FluentBundle.cpp b/intl/l10n/FluentBundle.cpp index ea599e115a1d..ccf04f672200 100644 --- a/intl/l10n/FluentBundle.cpp +++ b/intl/l10n/FluentBundle.cpp @@ -218,15 +218,15 @@ ffi::RawNumberFormatter* FluentBuiltInNumberFormatterCreate( switch (aOptions->currency_display) { case ffi::FluentNumberCurrencyDisplayStyleRaw::Symbol: options.mCurrency = Some(std::make_pair( - currency, NumberFormatOptions::CurrencyDisplayStyle::Symbol)); + currency, NumberFormatOptions::CurrencyDisplay::Symbol)); break; case ffi::FluentNumberCurrencyDisplayStyleRaw::Code: options.mCurrency = Some(std::make_pair( - currency, NumberFormatOptions::CurrencyDisplayStyle::Code)); + currency, NumberFormatOptions::CurrencyDisplay::Code)); break; case ffi::FluentNumberCurrencyDisplayStyleRaw::Name: options.mCurrency = Some(std::make_pair( - currency, NumberFormatOptions::CurrencyDisplayStyle::Name)); + currency, NumberFormatOptions::CurrencyDisplay::Name)); break; default: MOZ_ASSERT_UNREACHABLE();