Closed
Bug 874908
Opened 12 years ago
Closed 12 years ago
L20n don't switch language correctly.
Categories
(L20n :: JS Library, defect, P2)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
1.0
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.
Comment 1•12 years ago
|
||
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)
Reporter | ||
Comment 2•12 years ago
|
||
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 | ||
Updated•12 years ago
|
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → 1.0
Assignee | ||
Comment 3•12 years ago
|
||
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)
Assignee | ||
Comment 4•12 years ago
|
||
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.
Assignee | ||
Comment 5•12 years ago
|
||
Reporter, can you confirm that the behavior with the latest commit matches your expectations?
Flags: needinfo?(thesilentimp)
Assignee | ||
Comment 6•12 years ago
|
||
closing for now. If the bug still exists, please, reopen.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•