-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editorial: Identify the sanctioned units as a subset of CLDR #610
Conversation
spec/locales-currencies-tz.html
Outdated
</emu-alg> | ||
</emu-clause> | ||
|
||
<emu-clause id="sec-issanctionedsimpleunitidentifier" aoid="IsSanctionedSimpleUnitIdentifier"> | ||
<h1>IsSanctionedSimpleUnitIdentifier ( _unitIdentifier_ )</h1> | ||
|
||
<p> | ||
The IsSanctionedSimpleUnitIdentifier abstract operation verifies that the given core unit identifier is among the simple units sanctioned in the current version of the ECMAScript Internationalization API Specification, a subset of the Validity Data as described in <a href="https://unicode.org/reports/tr35/tr35.html#Validity_Data">UTS #35, Part 1, Section 3.11</a>; the list may grow over time. As discussed in UTS #35, a simple unit is one that does not have a numerator and denominator. The following steps are taken: | ||
The IsSanctionedSimpleUnitIdentifier abstract operation verifies that the _unitIdentifier_ argument (which must be a String value) is among the single unit identifiers sanctioned in the current version of the ECMAScript Internationalization API Specification, which are a subset of the Common Locale Data Repository <a href="https://github.com/unicode-org/cldr/blob/maint/maint-38/common/validity/unit.xml">release 38 unit validity data</a>; the list may grow over time. As discussed in UTS #35, a single unit identifier is a core unit identifier that is not composed of multiplication or division of other unit identifiers. The following steps are taken: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This text contains the only use of "current version of the ECMAScript Internationalization API Specification" that I could find (everywhere else uses "this specification" or "ECMAScript 2022 Internationalization API Specification"). A followup should reconcile that, ideally matching ECMA-262 (which seems to prefer "this specification").
@@ -248,11 +248,11 @@ <h1>IsSanctionedSimpleUnitIdentifier ( _unitIdentifier_ )</h1> | |||
</emu-alg> | |||
|
|||
<emu-table id="table-sanctioned-simple-unit-identifiers"> | |||
<emu-caption>Simple units sanctioned for use in ECMAScript</emu-caption> | |||
<emu-caption>Single units sanctioned for use in ECMAScript</emu-caption> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described in UTS #35, prefixed unit identifiers such as "centimeter" and "gigabit" are not simple. I've updated the text, but I'm thinking I should also rename the algorithm and replace the table id. Thoughts, @tc39/ecma402-editors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the terms "single" and "simple" were hammered down in UTS 35 and now ECMA-402 has bitrot. I think we should use the new UTS 35 terminology ("single" rather than "simple").
1. Return *true*. | ||
1. If the substring *"-per-"* does not occur exactly once in _unitIdentifier_, then | ||
1. Let _i_ be ! StringIndexOf(_unitIdentifier_, *"-per-"*, 0). | ||
1. If _i_ is -1 or ! StringIndexOf(_unitIdentifier_, *"-per-"*, _i_ + 1) is not -1, then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These editorial algorithm changes are gratuitous, but they do fit in with the rest of the PR.
@@ -248,11 +248,11 @@ <h1>IsSanctionedSimpleUnitIdentifier ( _unitIdentifier_ )</h1> | |||
</emu-alg> | |||
|
|||
<emu-table id="table-sanctioned-simple-unit-identifiers"> | |||
<emu-caption>Simple units sanctioned for use in ECMAScript</emu-caption> | |||
<emu-caption>Single units sanctioned for use in ECMAScript</emu-caption> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the terms "single" and "simple" were hammered down in UTS 35 and now ECMA-402 has bitrot. I think we should use the new UTS 35 terminology ("single" rather than "simple").
Co-authored-by: Shane F. Carr <shane@unicode.org>
Thanks @sffc , I have updated accordingly. |
5568eb9
to
51391a6
Compare
…and correctly use UTS 35 terms.
Fixes #564