Skip to content

Commit 08b6612

Browse files
authored
Deduplicate the section "Default Value of select Option" (#986)
1 parent 2e6ebcb commit 08b6612

File tree

1 file changed

+26
-49
lines changed

1 file changed

+26
-49
lines changed

spec/functions/number.md

Lines changed: 26 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -97,29 +97,6 @@ with _options_ on the _expression_ taking priority over any option values of the
9797
> would be formatted with the resolved options
9898
> `{ notation: 'scientific', minimumFractionDigits: '1' }`.
9999
100-
##### Default Value of `select` Option
101-
102-
The value `plural` is the default for the option `select`
103-
because it is the most common use case for numeric selection.
104-
It can be used for exact value matches but also allows for the grammatical needs of
105-
languages using CLDR's plural rules.
106-
This might not be noticeable in the source language (particularly English),
107-
but can cause problems in target locales that the original developer is not considering.
108-
109-
> For example, a naive developer might use a special message for the value `1` without
110-
> considering a locale's need for a `one` plural:
111-
>
112-
> ```
113-
> .input {$var :number}
114-
> .match $var
115-
> 1 {{You have one last chance}}
116-
> one {{You have {$var} chance remaining}}
117-
> * {{You have {$var} chances remaining}}
118-
> ```
119-
>
120-
> The `one` variant is needed by languages such as Polish or Russian.
121-
> Such locales typically also require other keywords such as `two`, `few`, and `many`.
122-
123100
##### Percent Style
124101
125102
When implementing `style=percent`, the numeric value of the _operand_
@@ -171,7 +148,7 @@ The following options and their values are required in the default registry to b
171148
function `:integer`:
172149
173150
- `select`
174-
- `plural` (default)
151+
- `plural` (default; see [Default Value of `select` Option](#default-value-of-select-option) below)
175152
- `ordinal`
176153
- `exact`
177154
- `numberingSystem`
@@ -209,29 +186,6 @@ Option values with the following names are however discarded if included in the
209186
- `maximumFractionDigits`
210187
- `minimumSignificantDigits`
211188
212-
##### Default Value of `select` Option
213-
214-
The value `plural` is the default for the option `select`
215-
because it is the most common use case for numeric selection.
216-
It can be used for exact value matches but also allows for the grammatical needs of
217-
languages using CLDR's plural rules.
218-
This might not be noticeable in the source language (particularly English),
219-
but can cause problems in target locales that the original developer is not considering.
220-
221-
> For example, a naive developer might use a special message for the value `1` without
222-
> considering a locale's need for a `one` plural:
223-
>
224-
> ```
225-
> .input {$var :integer}
226-
> .match $var
227-
> 1 {{You have one last chance}}
228-
> one {{You have {$var} chance remaining}}
229-
> * {{You have {$var} chances remaining}}
230-
> ```
231-
>
232-
> The `one` variant is needed by languages such as Polish or Russian.
233-
> Such locales typically also require other keywords such as `two`, `few`, and `many`.
234-
235189
##### Percent Style
236190
237191
When implementing `style=percent`, the numeric value of the _operand_
@@ -441,7 +395,7 @@ Some implementations might not be able to produce all of these formats for every
441395
The following options and their values are required to be available on the function `:currency`:
442396
443397
- `select`
444-
- `plural` (default)
398+
- `plural` (default; see [Default Value of `select` Option](#default-value-of-select-option) below)
445399
- `exact`
446400
- `currency`
447401
- well-formed [Unicode Currency Identifier](https://cldr-smoke.unicode.org/spec/main/ldml/tr35.html#UnicodeCurrencyIdentifier)
@@ -581,7 +535,7 @@ the value of other _options_, or all of these.
581535
The following options and their values are required to be available on the function `:unit`:
582536
583537
- `select`
584-
- `plural` (default)
538+
- `plural` (default; see [Default Value of `select` Option](#default-value-of-select-option) below)
585539
- `exact`
586540
- `unit`
587541
- valid [Unit Identifier](https://www.unicode.org/reports/tr35/tr35-general.html#unit-identifiers)
@@ -790,6 +744,29 @@ numeric selectors perform as described below.
790744
> Implementations are not required to implement this exactly as written.
791745
> However, the observed behavior must be consistent with what is described here.
792746
747+
#### Default Value of `select` Option
748+
749+
The value `plural` is the default for the option `select`
750+
because it is the most common use case for numeric selection.
751+
It can be used for exact value matches but also allows for the grammatical needs of
752+
languages using CLDR's plural rules.
753+
This might not be noticeable in the source language (particularly English),
754+
but can cause problems in target locales that the original developer is not considering.
755+
756+
> For example, a naive developer might use a special message for the value `1` without
757+
> considering a locale's need for a `one` plural:
758+
>
759+
> ```
760+
> .input {$var :number}
761+
> .match $var
762+
> 1 {{You have one last chance}}
763+
> one {{You have {$var} chance remaining}}
764+
> * {{You have {$var} chances remaining}}
765+
> ```
766+
>
767+
> The `one` variant is needed by languages such as Polish or Russian.
768+
> Such locales typically also require other keywords such as `two`, `few`, and `many`.
769+
793770
#### Rule Selection
794771
795772
Rule selection is intended to support the grammatical matching needs of different

0 commit comments

Comments
 (0)