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

Improve Language Redirection #10859

Closed
pmac opened this issue Dec 2, 2021 · 0 comments
Closed

Improve Language Redirection #10859

pmac opened this issue Dec 2, 2021 · 0 comments
Assignees
Labels
Bug 🐛 Something's not working the way it should

Comments

@pmac
Copy link
Member

pmac commented Dec 2, 2021

In bedrock we do redirection for URLs with no locale in them potentially 2 times.

  1. When the user first hits such a URL (e.g. /firefox/)
  2. Then potentially again if the best supported locale for the user doesn't have a translation for that page

An issue has arisen due to those two redirection and locale choosing mechanisms behaving differently. In bug 1743894 you can see an example.

The parsing and processing of the info in the Accept-Language header in the LocaleURLMiddleware class is handled mostly by code in the urlresolvers.py file. The 2nd redirect is handled by code in the l10n_utils module. The former seems to be doing a better job following the proper procedure outlined in the bug, while the latter is more naive. We should bring the 2nd redirect up to standard.

@pmac pmac added the Bug 🐛 Something's not working the way it should label Dec 2, 2021
robhudson added a commit to robhudson/bedrock that referenced this issue Dec 7, 2021
robhudson added a commit to robhudson/bedrock that referenced this issue Dec 7, 2021
@pmac pmac closed this as completed in e8eb7f3 Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something's not working the way it should
Projects
None yet
Development

No branches or pull requests

2 participants