[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search
 
Modify

CLDR Ticket #10922(closed spec: fixed)

Opened 8 months ago

Last modified 2 weeks ago

Clarifying usage of count="0" or count="1"

Reported by: pedberg Owned by: pedberg
Component: units Data Locale:
Phase: spec-beta Review: mark
Weeks: Data Xpath:
Xref:

ticket:9948

Description

For unitPattern elements, for the count attribute, we allow values of "0" and "1" in addition to the normal plural category keywords "zero", "one", "two", "few", "many", "other":
https://www.unicode.org/reports/tr35/tr35-general.html#Unit_Elements

We also allow this for characterLabelPattern elements in some cases:
https://www.unicode.org/reports/tr35/tr35-general.html#Character_Labels

However, we do not explain what these count values mean, or how to use them:

  • Do they refer to the exact numeric values 0.0 and 1.0, regardless of how the number is formatted?
  • How are they intended to be used vis-a-vis the keywords "zero" and "one" (which presumably overlap"0" and "1" in some cases), if rules exist for both? Do the "0" and "1" rules, if matched, take precedence over "zero" and "one" rules respectively, which might also match?

We need to call more attention to these cases and clarify their use. Possibly because this is not currently clear, at least some ICU formatting code for plural forms (e.g. for units?) does not currently appear to support the "0" or "1" cases. Perhaps not a big issue since we do not currently seem to have any CLDR data that uses the "0" or "1" cases.

Attachments

Change History

comment:1 follow-up: ↓ 4 Changed 8 months ago by mark

  • Status changed from new to accepted
  • Cc markus added
  • Priority changed from assess to major
  • Phase changed from spec-beta to dsub
  • Milestone changed from UNSCH to 34
  • Owner changed from anybody to pedberg

Intended usage of these are optional forms for cases like:

You have no books

instead of

You have {0} books captured under 'other'.

So it is purely up the the message writer whether to include =0, =1, etc.

The values are identity tests, eg x == 0

comment:2 Changed 3 months ago by pedberg

  • Phase changed from dsub to spec-beta

comment:3 Changed 3 months ago by shane

If ICU unit formatting doesn't support these plural forms (=0 and =1), it should be a pretty quick fix and I'm happy to take a look if there's a test case.

comment:4 in reply to: ↑ 1 Changed 2 weeks ago by pedberg

Replying to mark:

Intended usage of these are optional forms for cases like:
...

Yes but... that does not answer the specific questions I listed in the description bullet points which need to be clarified in the documentation.

comment:5 Changed 2 weeks ago by pedberg

OK, per e-mail discussion 2018-Oct-01 about what these count values mean, and how to use them

  • Q: Do they refer to the exact numeric values 0.0 and 1.0, regardless of how the number is formatted?
    • Peter: I am guessing the intent is that these refer to the numeric value regardless of formatting
    • Mark: They refer to the exact values 0 and 1 (that is, if the input is a double, then the decimal digits are zero as far as the eye can see). [Now arguably they should be *visually* zero, eg after rounding according to the NumberFormat, which is the way all the categories work. But for documenting how they work now, it should be equal to (int) 0 and (int) 1, respectively.
  • Q: How are they intended to be used vis-a-vis the keywords "zero" and "one" (which presumably overlap"0" and "1" in some cases), if rules exist for both? Do the "0" and "1" rules, if matched, take precedence over "zero" and "one" rules respectively, which might also match?
    • Peter: I am guessing the intent is that rules for 0 or 1, if present, take precedence over the rules for zero and one.
    • Mark: Yes, they take precedence over the named categories. Side note: They also don't necessarily fall into the categories zero and one: in English for example, 0 is of class "other".
  • Markus: In other words, =0 and =1 want to work just like in ICU MessageFormat.
    I am not sure about the use case for =0 in unit patterns... Even in MessageFormat =0 is often expressed as the absence of the message, rather than a specially worded one. I didn't look at the CLDR data here, though.

Also note that =0/=1 are allowed for more elements than I had previously thought. From ldml.dtd:

<!ATTLIST pattern count (0 | 1 | zero | one | two | few | many | other) #IMPLIED >
<!ATTLIST displayName count (0 | 1 | zero | one | two | few | many | other) #IMPLIED >
<!ATTLIST unitPattern count (0 | 1 | zero | one | two | few | many | other) #REQUIRED >
<!ATTLIST characterLabelPattern count (0 | 1 | zero | one | two | few | many | other) #IMPLIED >

<!ATTLIST dateFormatItem count (zero | one | two | few | many | other) #IMPLIED >
<!ATTLIST relativeTimePattern count (zero | one | two | few | many | other) #REQUIRED >
Last edited 2 weeks ago by pedberg (previous) (diff)

comment:6 follow-up: ↓ 7 Changed 2 weeks ago by shane

When there is data for this in CLDR, please file an ICU ticket and I can make sure it works.

comment:7 in reply to: ↑ 6 Changed 2 weeks ago by pedberg

Replying to shane:

When there is data for this in CLDR, please file an ICU ticket and I can make sure it works.

This ticket was just about clarifying the spec. We don't currently have any CLDR data that uses the cases "0" or "1.

comment:8 Changed 2 weeks ago by pedberg

  • Status changed from accepted to reviewing
  • Review set to mark

OK, I added some information; links below to the development version of the spec:

comment:9 Changed 2 weeks ago by pedberg

  • Xref set to 9948

Thi also addresses cldrbug 9948:

comment:10 Changed 2 weeks ago by mark

  • Status changed from reviewing to closed
  • Resolution set to fixed
View

Add a comment

Modify Ticket

Action
as closed
Next status will be 'new'
Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.