Closed Bug 1416562 Opened 7 years ago Closed 6 years ago

inappropriate redirect from e.g. /firefox/ to /de/firefox/ where a preference for German is inferior to en-GB, or en, without en-US

Categories

(www.mozilla.org :: Bedrock, defect)

Production
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: grahamperrin, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:56.0) Gecko/20100101 Firefox/56.0
Build ID: 20171107230505

Steps to reproduce:

01) prefer English (en-GB, with or without en) above German (de-de or de) without including en-US

02) visit <https://www.mozilla.org/firefox/quantum/>


Actual results:

03) redirect to <https://www.mozilla.org/de/firefox/quantum/> in German


Expected results:

03)  redirect to <https://www.mozilla.org/en-US/firefox/quantum/> in English 

(US English is closer than German to British English.)
<https://www.youtube.com/watch?v=ivzOQCXS3KU> 

- unlisted
- screen recording, 13.5 MiB, too large for attachment here

Reproducible – inappropriate redirection – where de-de is inferior to (below) en-GB. 

Not reproducible where fr-fr is inferior to en-GB. 

Reproducible where de is inferior to en-GB.
Cross reference <https://discourse.mozilla.org/t/-/21428/7?u=grahamperrin>, on closer inspection the issue is not limited to <https://www.mozilla.org/firefox/quantum/>. 

Other bugged URLs include: 

a) <https://mzl.la/newfirefox>, which is (if I understand correctly) 
   a short URL for <https://www.mozilla.org/firefox/>

b) <https://www.mozilla.org/firefox/desktop/>

c) <https://www.mozilla.org/firefox/nightly/all/>

– and so on, and without digging too much deeper, I guess that of _all_ the affected URLs, the one that's most likely to be promoted on and after Tuesday 2017-11-14 (campaign/launch date) is the short URL for downloads. 

----

> Not bugged
> 
> <https://www.mozilla.org/> correctly redirects to <https://www.mozilla.org/en-GB/>

Also bug-free from my current perspective: 

- <https://www.mozilla.org/firefox/nightly/> correctly redirects to 
  <https://www.mozilla.org/en-GB/firefox/channel/desktop/#nightly>

- <https://www.mozilla.org/thunderbird/> correctly redirects to 
  <https://www.mozilla.org/en-GB/thunderbird/>

- <https://www.mozilla.org/about/> correctly redirects to 
  <https://www.mozilla.org/en-GB/about/>
Summary: inappropriate redirect from /firefox/quantum/ to /de/firefox/quantum/ where a preference for German is inferior to en-GB, or en, without en-US → inappropriate redirect from e.g. /firefox/ to /de/firefox/ where a preference for German is inferior to en-GB, or en, without en-US
If it helps, <https://github.com/doverton51/testpilot/commit/c55875908b77b1f4f8e8c9ed2c41500ee457f045> (2017-07-25): 

> … Alter locale.js to look for available languages 
> based on the 2 character country code 
> before moving on to the next language.

– was a fix for: 

Privacy and Terms pages are displayed in the wrong locales if the first language is English[en] and the second is German[de] · Issue #2111 · mozilla/testpilot
<https://github.com/mozilla/testpilot/issues/2111>
Assignee: mitchell → nobody
Component: Miscellaneous → Bedrock
Product: mozilla.org → www.mozilla.org
Version: other → Production
(In reply to Graham Perrin from comment #0)
> User Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:56.0) Gecko/20100101
> Firefox/56.0
> Build ID: 20171107230505
> 
> Steps to reproduce:
> 
> 01) prefer English (en-GB, with or without en) above German (de-de or de)
> without including en-US
> 
> 02) visit <https://www.mozilla.org/firefox/quantum/>
> 
> 
> Actual results:
> 
> 03) redirect to <https://www.mozilla.org/de/firefox/quantum/> in German
> 
> 
> Expected results:
> 
> 03)  redirect to <https://www.mozilla.org/en-US/firefox/quantum/> in English 
> 
> (US English is closer than German to British English.)


I did some testing resulting in the following findings, essentially confirm observed behaviors from Graham:

Starting at https://www.mozilla.org/en-GB/firefox/ I then (attempt) to go to https://www.mozilla.org/en-GB/internet-health/ but I am redirected to https://www.mozilla.org/de/internet-health/ where: browser preferences are set to en-GB primary to de-de as secondary.

When selecting en-GB w. en-US as secondary I start at https://www.mozilla.org/en-GB/firefox/ I then (attempt) to go to https://www.mozilla.org/en-GB/internet-health/ but am sent to https://www.mozilla.org/en-US/internet-health/ I see the en-GB lang file for this page in Pontoon, so I'm not sure why this is occurring.  https://pontoon.mozilla.org/en-GB/mozillaorg/mozorg/internet-health.lang/?string=160526

So with these and Graham's more robust set of observations it's clear we need to take action. Thanks for pointing out the fix in testpilot and its possible reuse here.
(In reply to Eric Renaud from comment #4)

> … https://www.mozilla.org/en-GB/firefox/ I then (attempt) to go to
> https://www.mozilla.org/en-GB/internet-health/ but I am redirected to
> https://www.mozilla.org/de/internet-health/ where: browser preferences are
> set to en-GB primary to de-de as secondary.

I can no longer reproduce that with Waterfox 56.0.4.1 or Firefox 58.0.2. 
 
> When selecting en-GB w. en-US as secondary I start at
> https://www.mozilla.org/en-GB/firefox/ I then (attempt) to go to
> https://www.mozilla.org/en-GB/internet-health/ but am sent to
> https://www.mozilla.org/en-US/internet-health/

Not (or no longer) reproducible with Firefox 58.0.2. 

Browsers aside, I guess that fixes have been made server-side.
I tried to reproduce this bug using the following steps:

1.) Set my Accept-Language preference in Firefox to:

a. en-GB
b. de

2,) Visit https://www.mozilla.org/privacy/ (A URL that is translated in both en-US and de, but *not* enabled for en-GB)

Result:

I get redirected to https://www.mozilla.org/en-US/privacy/ and not https://www.mozilla.org/de/privacy/.

I can also confirm the same behavior with Chrome.

Based on the above, I'm going to close this as WORKSFORME. But feel free to reopen with some updated steps-to-reproduce if you think this is still an issue. Thanks
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.