From bf85bf2a9ec076a9bfa0ff0cfb2a97b2059818fc Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 7 Jul 2022 13:59:46 -0400 Subject: LibJS: Use Intl.PluralRules within Intl.RelativeFormat The Polish test cases added here cover previous failures from test262, due to the way that 0 is specified to be "many" in Polish. --- .../CodeGenerators/LibUnicode/GenerateUnicodeRelativeTimeFormat.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Meta/Lagom') diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeRelativeTimeFormat.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeRelativeTimeFormat.cpp index 0516b2dc85..03ff6c7d36 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeRelativeTimeFormat.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeRelativeTimeFormat.cpp @@ -58,7 +58,7 @@ struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, RelativeTimeFormat const& format) { return Formatter::format(builder, - "{{ TimeUnit::{}, Style::{}, RelativeTimeFormat::Plurality::{}, {}, {} }}", + "{{ TimeUnit::{}, Style::{}, PluralCategory::{}, {}, {} }}", format.time_unit, format.style, format.plurality, @@ -204,6 +204,7 @@ static ErrorOr generate_unicode_locale_implementation(Core::Stream::Buffer #include #include #include +#include #include namespace Unicode { @@ -224,7 +225,7 @@ struct RelativeTimeFormatImpl { TimeUnit time_unit; Style style; - RelativeTimeFormat::Plurality plurality; + PluralCategory plurality; @string_index_type@ tense_or_number { 0 }; @string_index_type@ pattern { 0 }; }; -- cgit v1.2.3