mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Add notation to Intl.PluralRules
This is a normative change in the ECMA-402 spec. See:
a7ff535
This commit is contained in:
parent
b16f34767e
commit
8e5cc74eb1
Notes:
github-actions[bot]
2025-05-27 14:40:25 +00:00
Author: https://github.com/trflynn89
Commit: 8e5cc74eb1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4894
9 changed files with 101 additions and 29 deletions
|
@ -45,8 +45,9 @@ Unicode::PluralCategory resolve_plural(PluralRules const& plural_rules, Value nu
|
|||
// 3. Let s be res.[[FormattedString]].
|
||||
// 4. Let locale be pluralRules.[[Locale]].
|
||||
// 5. Let type be pluralRules.[[Type]].
|
||||
// 6. Let p be PluralRuleSelect(locale, type, s).
|
||||
// 7. Return the Record { [[PluralCategory]]: p, [[FormattedString]]: s }.
|
||||
// 6. Let notation be pluralRules.[[Notation]].
|
||||
// 7. Let p be PluralRuleSelect(locale, type, notation, s).
|
||||
// 8. Return the Record { [[PluralCategory]]: p, [[FormattedString]]: s }.
|
||||
return plural_rules.formatter().select_plural(number.as_double());
|
||||
}
|
||||
|
||||
|
@ -65,7 +66,8 @@ ThrowCompletionOr<Unicode::PluralCategory> resolve_plural_range(VM& vm, PluralRu
|
|||
// a. Return xp.[[PluralCategory]].
|
||||
// 5. Let locale be pluralRules.[[Locale]].
|
||||
// 6. Let type be pluralRules.[[Type]].
|
||||
// 7. Return PluralRuleSelectRange(locale, type, xp.[[PluralCategory]], yp.[[PluralCategory]]).
|
||||
// 7. Let notation be pluralRules.[[Notation]].
|
||||
// 8. Return PluralRuleSelectRange(locale, type, notation, xp.[[PluralCategory]], yp.[[PluralCategory]]).
|
||||
return plural_rules.formatter().select_plural_range(start.as_double(), end.as_double());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue