You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Normative: Add [[CompactDisplay]] slot to Intl.PluralRules (#1019)
* Normative: Add [[CompactDisplay]] slot to Intl.PluralRules
This PR allows implementations to take into account potential differences between the short compact form ("5K") and long form ("5 thousand") when determining the correct plural form to use.
@@ -252,6 +259,7 @@ <h1>Properties of Intl.PluralRules Instances</h1>
252
259
<li>[[Locale]] is a String value with the language tag of the locale whose localization is used by the plural rules.</li>
253
260
<li>[[Type]] is one of the String values *"cardinal"* or *"ordinal"*, identifying the plural rules used.</li>
254
261
<li>[[Notation]] is one of the String values *"standard"*, *"scientific"*, *"engineering"*, or *"compact"*, identifying the notation used.</li>
262
+
<li>[[CompactDisplay]] is one of the String values *"short"* or *"long"*, specifying whether to display compact notation affixes in short form ("5K") or long form ("5 thousand") if formatting with the *"compact"* notation, as this can in some cases influence plural form selection. It is only used when [[Notation]] has the value *"compact"*.</li>
255
263
<li>[[MinimumIntegerDigits]] is a non-negative integer indicating the minimum integer digits to be used.</li>
256
264
<li>[[MinimumFractionDigits]] and [[MaximumFractionDigits]] are non-negative integers indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary.</li>
257
265
<li>[[MinimumSignificantDigits]] and [[MaximumSignificantDigits]] are positive integers indicating the minimum and maximum fraction digits to be used. Either none or both of these properties are present; if they are, they override minimum and maximum integer and fraction digits.</li>
@@ -272,12 +280,13 @@ <h1>
272
280
_locale_: a language tag,
273
281
_type_: *"cardinal"* or *"ordinal"*,
274
282
_notation_: a String,
283
+
_compactDisplay_: *"short"* or *"long"*,
275
284
_s_: a decimal String,
276
285
): *"zero"*, *"one"*, *"two"*, *"few"*, *"many"*, or *"other"*
277
286
</h1>
278
287
<dlclass="header">
279
288
<dt>description</dt>
280
-
<dd>The returned String characterizes the plural category of _s_ according to _locale_, _type_, and _notation_.</dd>
289
+
<dd>The returned String characterizes the plural category of _s_ according to _type_, _notation_, and _compactDisplay_ for the corresponding _locale_.</dd>
281
290
</dl>
282
291
</emu-clause>
283
292
@@ -301,24 +310,26 @@ <h1>
301
310
1. Let _locale_ be _pluralRules_.[[Locale]].
302
311
1. Let _type_ be _pluralRules_.[[Type]].
303
312
1. Let _notation_ be _pluralRules_.[[Notation]].
304
-
1. Let _p_ be PluralRuleSelect(_locale_, _type_, _notation_, _s_).
313
+
1. Let _compactDisplay_ be _pluralRules_.[[CompactDisplay]].
314
+
1. Let _p_ be PluralRuleSelect(_locale_, _type_, _notation_, _compactDisplay_, _s_).
305
315
1. Return the Record { [[PluralCategory]]: _p_, [[FormattedString]]: _s_ }.
_xp_: *"zero"*, *"one"*, *"two"*, *"few"*, *"many"*, or *"other"*,
316
327
_yp_: *"zero"*, *"one"*, *"two"*, *"few"*, *"many"*, or *"other"*,
317
328
): *"zero"*, *"one"*, *"two"*, *"few"*, *"many"*, or *"other"*
318
329
</h1>
319
330
<dlclass="header">
320
331
<dt>description</dt>
321
-
<dd>It performs an implementation-dependent algorithm to map the <emu-xrefhref="#sec-pluralruleselect">plural category</emu-xref> String values _xp_ and _yp_, respectively characterizing the start and end of a range, to a resolved String value for the plural form of the range as a whole denoted by _type_and _notation_ for the corresponding _locale_, or the String value *"other"*.</dd>
332
+
<dd>It performs an implementation-dependent algorithm to map the <emu-xrefhref="#sec-pluralruleselect">plural category</emu-xref> String values _xp_ and _yp_, respectively characterizing the start and end of a range, to a resolved String value for the plural form of the range as a whole denoted by _type_, _notation_, and _compactDisplay_ for the corresponding _locale_, or the String value *"other"*.</dd>
0 commit comments