Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Measure Unit Syntax #3

Closed
sffc opened this issue Apr 20, 2018 · 5 comments
Closed

Measure Unit Syntax #3

sffc opened this issue Apr 20, 2018 · 5 comments

Comments

@sffc
Copy link
Collaborator

sffc commented Apr 20, 2018

In the March 2018 Ecma 402 call, we agreed to add measure units as a "style" option and to have the options themselves be specified in a flat settings object.

We now need to name the settings. We need to name the following pieces:

{ style: "measure", unit: "length-meter", unitWidth: "<width>" }

Possible names for each piece:

  • style: this is already fixed in the spec.
  • measure: could be measure, measureUnit, unit, ...
  • unit: could be unit, measureUnit, ...
  • length-meter: this is a CLDR unit identifier. Should we keep this format, or should we adopt a different format in Ecma 402?
  • unitWidth: could be unitWidth, unitStyle, unitDisplay, measureDisplay, ...
    • note that the field currency has a field called currencyDisplay, so we could name this field similarly
  • <width>: these are the unit width options. CLDR calls them "long", "short", and "narrow". ICU MeasureFormat calls them "wide", "short", and "narrow". ICU NumberFormatter calls them "full name", "short", and "narrow".

Suggestions on each of the five parts of the syntax that need naming?

@sffc
Copy link
Collaborator Author

sffc commented May 15, 2018

Upstream issue reference:

@littledan
Copy link
Member

My personal uninformed opinions:

  • measure LGTM
  • unit LGTM
  • Sticking with CLDR conventions SGTM
  • I dunno about unitWidth, that sounds a little funny. Maybe unitDisplay is fine.
  • I like "long", "short" and "narrow"; this patches RelativeTimeFormat (maybe for the same reason of CLDR)

@fabalbon
Copy link
Member

I think I prefer:

{ style: "measure", measureUnit: "length-meter", measureDisplay: "<width>" }

As it makes it explicit that these options are for style: "measure"

@sffc
Copy link
Collaborator Author

sffc commented May 18, 2018

The precedent for currency is,

{ style: "currency", currency: "USD", currencyDisplay: "code" }

If we call this "unit", then the analogy would be,

{ style: "unit", unit: "length-meter", unitDisplay: "long" }

@littledan
Copy link
Member

We discussed this question in the May 2018 Intl meeting. The conclusion was:

  • style: "unit"
  • Use unit: rather than measure:
  • Stick with CLDR unit syntax
  • unitWidth: "short"/"narrow"/"long"

@sffc sffc closed this as completed Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants