Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect language redirection in addons.mozilla.org #4697

Closed
yookoala opened this issue Aug 24, 2017 · 5 comments
Closed

Incorrect language redirection in addons.mozilla.org #4697

yookoala opened this issue Aug 24, 2017 · 5 comments
Labels
component:i18n repository:addons-server Issue relating to addons-server state:stale Issues marked as stale. These can be re-opened should there be plans to fix them.

Comments

@yookoala
Copy link

Describe the problem and steps to reproduce it:

Website should follow browser's language priority when doing redirection / content detection. The "Accepted-Language" header include priority for the language in it. All redirection or locale detection should respect the priority specified there.

For example, when provided with this "Accepted-Language" header:

zh-HK,zh-TW;q=0.8,en-US;q=0.5,en;q=0.3"

a website should:

  1. find "zh-HK" (Traditional Chinese, Hong Kong) and "zh-TW" (Traditional Chinese, Taiwan) first. If exists, redirect / show the content in that language.
  2. If not exists, find "en-US". redirect / show the content in that language.
  3. If not exists, find "en". redirect / show the content in that language.

What happened?

If you supply a request to addons.mozilla.org/firefox with the said header:

zh-HK,zh-TW;q=0.8,en-US;q=0.5,en;q=0.3"

it will redirect you to addons.mozilla.org/zh-CN/firefox.

What did you expect to happen?

That is not an expected response. It is wrong in multiple levels:

  1. Even there is no "zh-HK" in the site, there is "zh-TW". From language priority, it should be shown.
  2. "zh-CN" is never a part of the language preference. If should not be shown, or it should be shown as a fallback only if both "zh-HK" and "zh-TW" are absent.
  3. Event without language priority to "zh-TW", the fallback to "zh-HK" should always be "zh-TW" (both Traditional Chinese).
@yookoala yookoala changed the title Incorrect redirection in addons.mozilla.org Incorrect language redirection in addons.mozilla.org Aug 24, 2017
@eviljeff
Copy link
Member

What's happening is we have fallback code that takes an unsupported long code (zh-HK) and converts it into a short code (zh) which then converts to the default for that short code (zh-CN). Then, because a locale has been 'found', it ignores the subsequent locale codes in the accept header. (It can also be replicated with pt-XX,pt-BR which redirects to pt-PT instead)

For zh-* see #4515 also

@yookoala
Copy link
Author

yookoala commented Aug 30, 2017

Is there anyway to override this redirection? The fallback of zh-HK or zh-Hant-HK should have been zh-Hant (if made available in 7d82b59, mozilla/addons-server#5811).

@eviljeff
Copy link
Member

In the end zh-Hant wasn't made available in mozilla/addons-server#5811, as #4515 mentions.

There isn't a way to override the redirection, we need to fix the logic. In the meantime you can visit https://addons.mozilla.org/zh-TW/firefox directly.

@stale
Copy link

stale bot commented Sep 6, 2019

This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.

@stale stale bot added the state:stale Issues marked as stale. These can be re-opened should there be plans to fix them. label Sep 6, 2019
@stale stale bot closed this as completed Sep 20, 2019
@yookoala
Copy link
Author

The issue is still not fixed. Please re-open this issue.

@KevinMind KevinMind transferred this issue from mozilla/addons-server May 4, 2024
@KevinMind KevinMind added repository:addons-server Issue relating to addons-server migration:2024 labels May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:i18n repository:addons-server Issue relating to addons-server state:stale Issues marked as stale. These can be re-opened should there be plans to fix them.
Projects
None yet
Development

No branches or pull requests

5 participants