-
Notifications
You must be signed in to change notification settings - Fork 9
Include non-canonical names in the Available operations, then filter them out #49
Conversation
Calendar, collations, and numbering systems should probably be canonicalised according to the same language as in ResolveLocale, step 9.i.iii.1:
(That step occurs twice in ResolveLocale, I guess it's just a copy-paste error?) |
I think that link might be stale? It seems to point to how to canonicalize the whole locale ID, but doesn't say anything about casing of ukey and uvalue. (In this table they are defined as |
The section contains a link to Annex C. LocaleId Canonicalization, which defines the actual canonicalisation algorithm. I know that these two sections were restructured at some point, but I don't know if the links in ECMA-402 were created before or after that restructuring. (That also means I don't know if we intentionally link to Canonical Unicode Locale Identifiers instead of Annex C. LocaleId Canonicalization.) |
@anba Is it specifically the step "Put all other subtags into lowercase" in https://unicode.org/reports/tr35/#5-canonicalizing-syntax that you're referring to? |
That's the first step when applying canonicalisation, at the end of it the source should be in "canonical syntax". But we also want it to be in "canonical form" (both terms are defined in UTS 35). Annex C. LocaleId Canonicalization, section Processing LocaleIds further defines how to canonicalise so-called alias entries:
This is relevant for "calendar" to canonicalise |
d70c303
to
a97f16e
Compare
OK, I've made an attempt to address this comment; a couple things to note:
|
We should use the same language to canonicalize Unicode extension values everywhere. So if ResolveLocale applies it on standalone
|
The Available abstract operations (e.g. AvailableCalendars) should return all possible aliases, so that other places in the spec (e.g. the Temporal.Calendar constructor) can use them to determine whether a given input value is valid. This input value can subsequently be canonicalized by another abstract operation (e.g. CanonicalizeCalendar). In Intl.supportedValuesOf(), on the other hand, we should _not_ return all possible aliases, so we filter them out using a Canonicalize operation before returning the list of Available codes as an array to the caller. Not all of the kinds of codes here have aliases, and not even all of them have a concept of "canonical". A quick investigation shows: - Calendar: aliased; case-regularized; limited values "available" but any well-formed value accepted, unknown values coerced to the locale's default - Collation: aliased, but web reality is that aliases are ignored; case-regularized; limited values "available" but any well-formed value accepted, unknown values coerced to the locale's default - Currency: not sure if it is aliased because I don't have a copy of ISO 4217; case-regularized; limited values "available" but any well-formed value accepted and used - Numbering system: not currently aliased; not case-regularized; limited values "available" but any well-formed value accepted, unknown values coerced to the locale's default - Time zone: aliased; case-regularized - Unit of measurement: not aliased; not case-regularized; limited values "available" but simple combinations of core values also accepted and used So, I conclude that we need Canonicalize operations for calendars, time zones, collation types, numbering systems, and possibly currency units. An alternative approach would be to write Canonicalize operations for all of the kinds of codes, and have them perform the case-regularization (and for units of measurement they would be no-ops). Closes: tc39#37
a97f16e
to
ee5047b
Compare
OK. |
Any other reviews on this one? |
This is beyond the scope of what this proposal aim to resolve. I am fine with you or anyone else to propose a ECMA402 PR to achieve that but I am very against to loop that beyond-scope objective into this proposal. This proposal already reach Stage 3 and as the champion of it, I am not comfortable to enlarge the scope of this proposal for that reason. I rather we push this proposal to Stage 4 , merge it into ECMA402 and then you or someone else could propose a ECMA402 PR to achieve that. |
That's disappointing to hear, since it would mean that I'll have to waste a lot of time later rewriting the work you're doing here, so that AvailableCalendars and AvailableTimeZones become useful for Temporal, when we could just unify this work now. I'd ask you to reconsider, please. |
I’m confused why an editorial-only change would be considered beyond the scope of a proposal. |
1, I do NOT believe this is "an editorial-only change". |
I am not opposing you propose to change AvailableCalendars and AvailableTimeZones after it get into ECMA402. I am against you put that part of change into this proposal which is already in Stage 3 for a while and already shipped in chrome m99, Safari 15.4 and Firefox 93. You propose a very big change to spec text right before we could merge into ECMA402 as Stage 4 and that is why I am opposing. I am not opposing the spec change you made, i am opposing the process / channel you suggest to move that change into ECMA402. |
If his change is truely editorial-only (which I do not believe so) then he can simply propose a ECMA402 editorial PR to merge that in now or after we merge this proposal into ECMA402, right? then why rush now ? |
Here's my understanding of the situation:
Is my understanding wrong? If you would like to have a call to discuss this, or discuss it in the TG2 meeting, let me know. |
Here are the differences: You are assuming the "adding non-canonical id and filter out later" approach is acceptable and will reach consensus. In that case, your path is clear as what you stated and will save people's time. I simply does not want this proposal to be part of the debate of "adding non-canonical id and filter out later" approach. As an alternative, you can easily define a different AOs - CanonicalAndNonCanonicalCalendars() , which return the union of the result of AvailableCalendars() and ExtraNonCanonicalCalendars() for your purpose. I prefer "only return canonical id and add non-cananoical ids" approach in the AO better since that will encourage optimized code for performance. |
I don't understand what makes you think it would be controversial, if implementations don't have to change anything. Who do you expect will object to this? Is there a way we could change the way it's expressed so that it has less potential to be controversial? |
The fact we arguing about this PR for so long here already prove it is controversial, right? I ASSUME everything COULD BE controversial BY DEFAULT |
I'm really annoyed that you insist no compromise is possible on this. Especially since over the last 1.5 years I've spent a considerable amount of my time adjusting the Temporal spec in Stage 3 to address concerns from you, working to find solutions that make everyone as happy as possible, including things that I felt were out of scope or introduced risk of delay. This is just a waste of my time, so I'll close this PR. At least, please revert the rename you just did from AvailableXXX to AvailableCanonicalXXX. It makes the situation worse because it presumes that the simpler change will never make it into ECMA-402. |
For what it's worth, I find it far more controversial, and more likely to block this proposal hitting stage 3, to reject this change than to accept it ¯\_(ツ)_/¯ |
Just to be clear - I would absolutely not block Intl Enumeration on those grounds. As annoyed as I am about this, blocking in retaliation would drag everybody down. |
Oh, same, I'm just clarifying that inaction can often be more controversial than action, not less. |
Fact: This proposal is already in Stage 3 since July 2021. |
haha ok fair point, then i'm unclear on your resistance since it's only stage 4 you need to secure. |
Fact: chrome m99, Safari 15.4 and Firefox 93 already ship with this proposal. Here is what I like to see
|
The Available abstract operations (e.g. AvailableCalendars) should return all possible aliases, so that other places in the spec (e.g. the
Temporal.Calendar
constructor) can use them to determine whether a given input value is valid. This input value can subsequently be canonicalized by another abstract operation (e.g. CanonicalizeCalendar).In
Intl.supportedValuesOf()
, on the other hand, we should not return all possible aliases, so we filter them out using a Canonicalize operation before returning the list of Available codes as an array to the caller.Not all of the kinds of codes here have aliases, and not even all of them have a concept of "canonical". A quick investigation shows:
Calendar: aliased; case-regularized; limited values "available" but any well-formed value accepted, unknown values coerced to the locale's default
Collation: not aliased; case-regularized; limited values "available" but any well-formed value accepted, unknown values coerced to the locale's default
Currency: not sure if it is aliased because I don't have a copy of ISO 4217; case-regularized; limited values "available" but any well-formed value accepted and used
Numbering system: not aliased; not case-regularized; limited values "available" but any well-formed value accepted, unknown values coerced to the locale's default
Time zone: aliased; case-regularized
Unit of measurement: not aliased; not case-regularized; limited values "available" but simple combinations of core values also accepted and used
So, I conclude that we need Canonicalize operations for calendars, time zones, and possibly currency units.
An alternative approach would be to write Canonicalize operations for all of the kinds of codes, and have them perform the case-regularization (or for numbering systems and units of measurement they would be no-ops).
(This pull request is currently based on top of #48, I will rebase it when that is merged)
Closes: #37