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

CLDR Ticket #6020(closed: fixed)

Opened 6 years ago

Last modified 3 weeks ago

Change "per" pattern

Reported by: mark Owned by: mark
Component: other Data Locale:
Phase: dsub Review: pedberg
Weeks: Data Xpath:



Description (last modified by mark) (diff)

The 'per' pattern doesn't work for inflected languages, where the denominator changes. A possible solution:

Add the <unitPer> element, as in the following:

		<unitLength type="long">
			<compoundUnit type="per">
				<compoundUnitPattern>{0} per {1}</compoundUnitPattern>
<!-- ADD -->
                        <unitPer type="duration-second">{0} per second</unitPer>
                        <unitPer type="duration-hour">{0} per hour</unitPer>
<!-- ADD -->
			<unit type="acceleration-g-force">
				<unitPattern count="one">{0} g-force</unitPattern>
				<unitPattern count="other">{0} g-force</unitPattern>

A difference from the <unit> type is that there is no count parameter; these are always singular.

We'd use this as follows.

When constructing numerator=N, denominator=D:

  1. format the numerator pattern with the number (eg "3 kilograms")
  2. See if there is a pattern for the denominator-per pattern (eg "{0} per-second").
  3. If so, then substitute the formatted numerator into the denominator pattern (eg "3 kilograms per second")
  4. If not, get the compoundUnit "per" pattern, and substitute the formatted numerator for {0} and the singular form of the denominator for {1} (eg {0} per {1} => "3 kilograms per second)


I would guess that the following would be the most immediately needed, but we need to check:

  • duration (hour, minute, second) probably the highest priority
  • length (m, cm, ft, in)
  • area (m2, ft2)
  • volume (m3, ft3)


It is a known limitation we don't support inflection of units in general. That is, we don't provide for cases where someone wants to construct a sentence like:

The city is at a distance 23 kilometers-of. (where I'm attaching the preposition to represent an inflection.)

The current goal for CLDR is to support styles like:

Distance: 23 kilometers per second


Change History

comment:1 Changed 6 years ago by mark

  • Description modified (diff)

comment:2 Changed 6 years ago by mark

  • Description modified (diff)

comment:3 Changed 6 years ago by mark

Review this also with #5997 and decide what to do.

comment:4 Changed 6 years ago by emmons

  • Xref set to 5997 5955
  • Component changed from unknown to design
  • Milestone changed from UNSCH to 25dsub

comment:5 Changed 5 years ago by emmons

  • Owner changed from anybody to mark
  • Status changed from new to assigned

comment:6 Changed 5 years ago by mark

  • Description modified (diff)

Updated proposal.

comment:7 Changed 5 years ago by mark

  • type changed from unknown to defect
  • Description modified (diff)

comment:8 Changed 5 years ago by emmons

  • Milestone changed from 25dsub to 25rc

Moving all 25dsub and 25design tickets to 25rc. If you plan to complete items in the 25M1 time frame, please move those tickets to 25M1.

comment:9 Changed 5 years ago by mark

Rather than the above, I suggest that we add them in the appropriate unit, eg:

<unit type="duration-second">

<unitPattern count="one">{0} second</unitPattern>
<unitPattern count="other">{0} seconds</unitPattern>
<unitPer>{0} per second</unitPer>


That groups everything together, making it less likely that we'd have gratuitous differences. They should be also grouped together in the ST.

Last edited 5 years ago by mark (previous) (diff)

comment:10 Changed 5 years ago by mark

  • Component changed from design to data

Design accepted by committee Nov 13

comment:11 Changed 5 years ago by mark

  • Milestone changed from 25rc to 26dsub

comment:12 Changed 5 years ago by mark

  • Status changed from assigned to reviewing
  • Review set to pedberg

comment:13 Changed 4 years ago by mark

One item to add: if there is already a combined unit, use it first.

Example: {0} mph.

comment:14 Changed 4 years ago by mark

The name was changed to

<perUnitPattern>{0} per second</perUnitPattern>

comment:15 Changed 4 years ago by rocketman@…

<perUnit> -> <perUnitPattern>

comment:16 Changed 4 years ago by pedberg

  • Priority changed from assess to major
  • Status changed from reviewing to closed
  • Resolution set to fixed

These are in coverageLevels.xml too, must have been added under another ticket

comment:17 Changed 4 years ago by markus

  • Phase set to dsub
  • Milestone changed from 26dsub to 26

comment:18 Changed 3 weeks ago by mark

  • Component changed from main to other

Add a comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.