Closed Bug 874908 Opened 12 years ago Closed 12 years ago

L20n don't switch language correctly.

Categories

(L20n :: JS Library, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: thesilentimp, Assigned: zbraniecki)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36 Steps to reproduce: I try to switch between russian and english language. Manifesto: { "languages": [ "en-GB", "ru-RU" ], "resources": [ "language/{{lang}}/data.l20n" ] } Actual results: When Accept-Language header is set to "ru" — "ru-RU" just don't work Expected results: When Accept-Language header is set to "ru" it should switch to russian language.
It looks like Intl.prioritizeLocales doesn't match "ru" in the Accept-Language header with "ru-RU" in the manifest. Gandalf, is this expected?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(gandalf)
Header in Chrome: Accept-Language:ru,en;q=0.8,en-US;q=0.6 Headers in Firefox: Accept-Language:ru,en-us;q=0.7,en;q=0.3
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → 1.0
The reason why this doesn't work is because your app reports to support only en-GB flavor which is more specific than what your user requests. The Ecma 402 ( http://ecma-international.org/ecma-402/1.0/ ) does not support such scenario. What you should do is provide "ru" language and then both "ru-RU" and "ru" in request will match it.
Flags: needinfo?(gandalf)
Saying that, I see a limitation of language tag not being canonicalizied and that we return wrong lists of matching locales. I filed bug 879997 to update that.
Reporter, can you confirm that the behavior with the latest commit matches your expectations?
Flags: needinfo?(thesilentimp)
closing for now. If the bug still exists, please, reopen.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
clearning NI
Flags: needinfo?(thesilentimp)
You need to log in before you can comment on or make changes to this bug.