Closed Bug 1093784 Opened 10 years ago Closed 10 years ago

unreliable language detection on mozilla.org pages without locale string in the url

Categories

(www.mozilla.org :: Pages & Content, defect)

Production
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: philipp, Unassigned)

References

()

Details

Attachments

(2 files)

Attached image screenshot
when you visit a page like https://www.mozilla.org/security/known-vulnerabilities/firefox/ that has no string in the url specifying a locale, the tabzilla section and links to other localized pages on mozilla.org sometimes end up in arbitrary languages neither related to your language settings or geo-location (see screenshot).

this problem is intermittent and can usually be resolved by a force-refresh - the locale then reflects the language chosen in the firefox options > content, so it might be related to caching...
I agree that it's most likely cache that's causing problems here. The primary issue however is that while the content for this kind of page (no locale) will always be the default locale (en-US) the server is still trying to work out which locale is best based on your browser settings. This result is then used in things like figuring out which tabzilla URL to get. This is then cached and you get what you're seeing. I think we either need to default at least tabzilla to no locale, thus letting tabzilla work out for itself which locale is best for the individual user, or if we think it's still strange for an english page to have a non-english tabzilla, then we can force these kinds of pages to always go with en-US for everything.

What do you think Jen and/or Holly?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jbertsch)
Flags: needinfo?(hhabstritt.bugzilla)
Pmac-

What do you think the reason is that https://www.mozilla.org/security/known-vulnerabilities/firefox/ isn't defaulting to en-us?

I can think of a use case where Tabzilla and the web page don't match (locale exists for Tabzilla but doesn't exist for the web page), but don't complete understand why a browser locale can't be determined by the server?

Thx,
Jen
Flags: needinfo?(jbertsch)
The issue is that the browser locale is being determined by the server, but since the locales aren't unique URLs, the cache is just getting the version from when the cache was last empty. So the first person to get to the page wins and everyone subsequent while the cache is full gets their version of the page, including the locale of Tabzilla. So the server knows the user's preferred locale, but the page will always be in english and we've not accounted for the fact that the page can in-fact differ per browser Accept-Language header.

A simple fix actually is to not exclude these URLs from the typical locale prefix. This will always (for the foreseeable future at least) be /en-US/, but it would force the server to accept that en-US is the display language and therefore all other things will be that as well. But this could be an issue on other locale-prefix exempt URLs and we've just not seen it yet.
Although, looking at it now, these may be the first and only pages (/security/ that is) that use the default templates which include tabzilla. Other examples so far in bedrock are things like /credits/ and other non-html things like robots.txt and contribute.json. Perhaps the answer really should be that we enable the locale prefix so it's consistent with the rest of the site.
(In reply to Paul McLanahan [:pmac] from comment #4)
>  Perhaps the answer
> really should be that we enable the locale prefix so it's consistent with
> the rest of the site.

+1 unless there's a good reason I can't think of not to (it shouldn't impact bookmarks or redirects to those long standing security page, right?)
Commits pushed to master at https://github.com/mozilla/bedrock

https://github.com/mozilla/bedrock/commit/6331dedafb4526c2731a5694ccc048accfedf7c9
Fix bug 1093784: Remove locale URL exemption from security pages.

https://github.com/mozilla/bedrock/commit/84bafcbad3159f5c225d6cab7026a5318ea8c54f
Merge pull request #2510 from pmclanahan/fix-tabzilla-security-pages-1093784

Fix bug 1093784: Remove locale URL exemption from security pages.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Flags: needinfo?(hhabstritt.bugzilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: