Skip to content

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

Open

Description

@shihaohong

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.

Activity

  1. mosuem commented on Oct 20, 2022

    @mosuem
    Member

    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?

  2. added
    type-enhancementA request for a change that isn't a bug
    P4A feature or bug we're unlikely to address
    on Oct 20, 2022
  3. alan-knight commented on Oct 20, 2022

    @alan-knight
    Contributor
  4. added
    P3A lower priority bug or feature request
    and removed
    P4A feature or bug we're unlikely to address
    on Nov 3, 2022
  5. transferred this issue fromdart-archive/intlon Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestpackage:intltype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions