Editorial: Identify the sanctioned units as a subset of CLDR#610
Editorial: Identify the sanctioned units as a subset of CLDR#610gibson042 wants to merge 7 commits intotc39:masterfrom
Conversation
spec/locales-currencies-tz.html
Outdated
|
|
||
| <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.
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").
|
|
||
| <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.
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.
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.
These editorial algorithm changes are gratuitous, but they do fit in with the rest of the PR.
|
|
||
| <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.
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