mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 20:04:59 +00:00
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.
This commit is contained in:
parent
36abcd820d
commit
bf85bf2a9e
6 changed files with 119 additions and 67 deletions
|
@ -58,7 +58,7 @@ struct AK::Formatter<RelativeTimeFormat> : Formatter<FormatString> {
|
|||
ErrorOr<void> format(FormatBuilder& builder, RelativeTimeFormat const& format)
|
||||
{
|
||||
return Formatter<FormatString>::format(builder,
|
||||
"{{ TimeUnit::{}, Style::{}, RelativeTimeFormat::Plurality::{}, {}, {} }}",
|
||||
"{{ TimeUnit::{}, Style::{}, PluralCategory::{}, {}, {} }}",
|
||||
format.time_unit,
|
||||
format.style,
|
||||
format.plurality,
|
||||
|
@ -204,6 +204,7 @@ static ErrorOr<void> generate_unicode_locale_implementation(Core::Stream::Buffer
|
|||
#include <AK/Vector.h>
|
||||
#include <LibUnicode/Locale.h>
|
||||
#include <LibUnicode/RelativeTimeFormat.h>
|
||||
#include <LibUnicode/UnicodePluralRules.h>
|
||||
#include <LibUnicode/UnicodeRelativeTimeFormat.h>
|
||||
|
||||
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 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue