Skip to content

Support for explicit 0 and 1 rules for number formatting #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
shihaohong opened this issue Jun 21, 2021 · 2 comments
Open

Support for explicit 0 and 1 rules for number formatting #21

shihaohong opened this issue Jun 21, 2021 · 2 comments
Labels
P3 A lower priority bug or feature request package:intl type-enhancement A request for a change that isn't a bug

Comments

@shihaohong
Copy link

Original Flutter issue: flutter/flutter#84291
Taken directly from https://unicode-org.github.io/cldr/ldml/tr35-numbers.html#Explicit_0_1_rules:

Some types of CLDR data (such as unitPatterns and currency displayNames) allow specification 
of plural rules for explicit cases “0” and “1”, in addition to the language-specific plural cases specified 
above: “zero”, “one”, “two” ... “other”:

- The explicit “0” and “1” cases are not defined by language-specific rules, and are available in any 
language for the CLDR data items that accept them.
- The explicit “0” and “1” cases apply to the exact numeric values 0 and 1 respectively. These cases
are typically used for plurals of items that do not have fractional value, like books or files.
- The explicit “0” and “1” cases have precedence over the “zero” and “one” cases. For example, if 
for a particular element CLDR data includes values for both the “1” and “one” cases, then the “1” 
value is used for numeric values of exactly 1, while the “one” value is used for any other formatted 
numeric values matching the “one” plural rule for the language.
@mosuem
Copy link
Member

mosuem commented Oct 20, 2022

I am not sure I understand this correctly, but this is quoting the LDML rules for CLDR data - intl supports the ICU MessageFormat, which explicitly states

Note: In a plural argument like in the example above, if the English message has both =0 and =1 (up to =offset+1) then it does not need a “one” variant because that would never be selected. It does always need an “other” variant.

Also, while =1 and one are semantically different, there is are no differences in the result. The only benefit I see is the ease of use for translators, who may be used to one, two etc. Am I missing something?

@mosuem mosuem added type-enhancement A request for a change that isn't a bug P4 A feature or bug we're unlikely to address labels Oct 20, 2022
@alan-knight
Copy link
Contributor

alan-knight commented Oct 20, 2022 via email

@mosuem mosuem added P3 A lower priority bug or feature request and removed P4 A feature or bug we're unlikely to address labels Nov 3, 2022
@mosuem mosuem transferred this issue from dart-archive/intl Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 A lower priority bug or feature request package:intl type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants