Skip to content
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

Why does ResolveLocale drop Unicode extension keys without values? #223

Closed
anba opened this issue Mar 16, 2018 · 5 comments · Fixed by #302
Closed

Why does ResolveLocale drop Unicode extension keys without values? #223

anba opened this issue Mar 16, 2018 · 5 comments · Fixed by #302

Comments

@anba
Copy link
Contributor

anba commented Mar 16, 2018

var opt1 = new Intl.Collator("de-u-kn").resolvedOptions();
var opt2 = new Intl.Collator("de-u-kn-true").resolvedOptions();

print(`locale=${opt1.locale}, caseFirst=${opt1.numeric}`);
print(`locale=${opt2.locale}, caseFirst=${opt2.numeric}`);

The test case should print this per the current spec:

locale=de, caseFirst=true
locale=de-u-kn-true, caseFirst=true

I don't understand why the resolved locale of the first collator is not set to either de-u-kn or de-u-kn-true. If the current behaviour is not a spec bug, can we add a comment to clarify why Unicode extensions keys without values are removed from the resolved locale?

@littledan
Copy link
Member

Huh, that's interesting.

Would fixing this be a matter of adding a simple step as ResolveLocale 8.h.ii.2.b Let supportedExtensionAddition be the concatenation of "-" and key ? If so, that sort of change sounds right to me.

(Aside: Wow, there's a lot of variation among implementations for how the locale presents these tags.)

@srl295
Copy link
Member

srl295 commented Apr 20, 2018

caseFirst=${opt1.numeric}

should be numeric=${opt1.numeric}?

@littledan
Copy link
Member

littledan commented Apr 25, 2018

Rather than just making this one fix (which, in isolation, would seem good), let's see if we can make this part of a broader change. If that one doesn't seem feasible, we can come back and make this one fix.

@FrankYFTang
Copy link
Contributor

I try to fix a bug in v8 and then my fix broke intl402/Collator/missing-unicode-ext-value-defaults-to-true.js and I reach the same conclusion this looks strange.
I would second we add to ResolveLocale https://tc39.github.io/ecma402/#sec-resolvelocale a step 8.h.ii.2.b as "Let supportedExtensionAddition be the concatenation of "-" and key."

@FrankYFTang
Copy link
Contributor

Huh, that's interesting.

Would fixing this be a matter of adding a simple step as ResolveLocale 8.h.ii.2.b Let supportedExtensionAddition be the concatenation of "-" and key ? If so, that sort of change sounds right to me.

(Aside: Wow, there's a lot of variation among implementations for how the locale presents these tags.)

Yes, I think we should fix the spec this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants