Add support for unit inflections

Description

CLDR is adding gender and inflections for units of measurement. This involves supporting the following:

When formatting units of measurement:

  • Take the desired case as an input parameter [done in ICU 69 as tech preview]

  • Pick the requested case variant of the unit [done in ICU 69 as tech preview]

  • For complex units (square-inch), construct the name using the requested case, and the appropriate gender. [arbitrary units: done in ICU 69, case selection is tech preview)]

  • Return the resulting case and gender [ICU 69 tech preview returns gender wherever possible]

Return the available cases and units for a given locale: [NOT done in ICU 69]

  • eg for German, return case={nominative, accusative, dative, genitive}, gender={masculine, feminine, neuter}

  • also permit filtering by Scope (particularly Scope=units)

 

Follow-up tickets to track continued work no longer within the scope of this ticket:

  • MIXED units gender support: and

  • MIXED units case support:

  • Do we need the “get available cases and genders for a locale” API? I think we do, but I can not yet give a clean and good argument for a use case. (ICU’s use in translation/localization tools, to enumerate options?)

  • Promotion from “tech preview” to “draft”: ,

Activity

Show:
Hugo van der Merwe
March 10, 2021, 10:05 PM

I believe I should not be the Reviewer for this ticket. I’ll keep an eye on it, particularly if Mark is overloaded - for now I’m assigning to Mark though.

We’ve done the first part, we’ve not done the second part. I’ll highlight this by editing the original description…

Hugo van der Merwe
March 9, 2021, 4:59 PM

Inflections for MIXED units not supported: we don’t have list rules for grammatical-gender yet (only binary person gender). Display Case also not implemented: option to have a first iteration just assuming case distributes to each list item?

Hugo van der Merwe
March 9, 2021, 4:57 PM

PR 1620 is still open: I have an approval from Younies though. Marking this ticket as “reviewing”: could help make the call to merge 1620?

Hugo van der Merwe
March 3, 2021, 5:56 PM

I filed to track work in the next release - taking Inflections support out of Technical Preview.

Hugo van der Merwe
February 7, 2021, 4:00 PM

And for 69: “technical preview”, rather than “officially draft” APIs.

Fixed
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Hugo van der Merwe

Reporter

Mark Davis

Components

Reviewer

Mark Davis

Priority

medium

Fix versions