You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// classic string from a browser with both en-us and en-gbvarlocs=newLocale.Locales('it-it, it;q=0.9, en-us;q=0.8, en-gb;q=0.7, en;q=0.6')varbest=locs.best(newLocale.Locales('en-gb,en,fr,de','en'));best.normalized
This print: en
I would have expected en_GB since it is in the list of supported languages and it has an higher score then en (0.7 vs 0.6).
if I replace en-gb with en-us in the supported list I get en-us as expected
The text was updated successfully, but these errors were encountered:
danielesegato
changed the title
best() chose the wrong locale in some corner case
best() choose the wrong locale in some corner case
Jan 24, 2017
danielesegato
changed the title
best() choose the wrong locale in some corner case
best() choose locale en when it should chose locale en_GB
Jan 24, 2017
danielesegato
changed the title
best() choose locale en when it should chose locale en_GB
best() choose locale en when it should pick locale en_GB
Jan 24, 2017
Using locale version 0.1.0.
Take this example:
This print:
en
I would have expected
en_GB
since it is in the list of supported languages and it has an higher score thenen
(0.7 vs 0.6).locs:
if I replace
en-gb
withen-us
in the supported list I geten-us
as expectedThe text was updated successfully, but these errors were encountered: