-
Notifications
You must be signed in to change notification settings - Fork 501
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
feat(language-menu): add automatic redirect experiment #11518
base: main
Are you sure you want to change the base?
Conversation
Unless the user manually switched the locale for the current page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, but I'm torn on the overall behaviour:
Obviously the current behaviour is an annoyance to many users, since we've received a number of reports about it, but a fix which results in pasting a link containing e.g. the fr locale in and being redirected to en-US because of prior behaviour feels wrong.
However, I don't see an elegant way to do this in some cases but not others, so this feels like the best approach for most people. Let's see if we get an influx of issues filed saying they want something like the old behaviour back.
I imagine most users who need to switch between locales a lot are in our close community (eng/content/l10n), and perhaps we should let them know ahead of time that setting the cookie to something like false
will disable this behaviour - perhaps we should explicitly support that, and leave it untouched when using the dropdown menu in this case - that can be a follow up task/PR though.
I realize that this could indeed be an annoyance for us, when looking at issues, and for translators.
I agree that we should support opt-out from this feature, maybe even via the UI from the locale dropdown. |
fwiw I filled #11717 |
This makes the Switch appear as big as surrounding text.
d539049
to
a3be882
Compare
Summary
(MP-1242)
Fixes #275.
Fixes #2528.
Fixes #2724.
Fixes #6981.
Problem
en-US
if a page is not available in a locale, but this means the user has to manually navigate back to their preferred locale.Solution
We already have a
preferredlocale
cookie that we set when the user switches the locale in the user interface.Use this cookie to automatically redirect the user to the preferred locale under these circumstances:
Caveat: Changing the locale directly in the address bar will still redirect back.
How did you test this change?
Ran
npm start
in/cloud-function
, then tested locally withxh
: