-
Notifications
You must be signed in to change notification settings - Fork 509
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 "Remember language" experiment #11518
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
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.
Overall looks good to me, a few small comments:
client/src/ui/organisms/article-actions/language-menu/index.scss
Outdated
Show resolved
Hide resolved
client/src/ui/organisms/article-actions/language-menu/index.tsx
Outdated
Show resolved
Hide resolved
client/src/ui/organisms/article-actions/language-menu/index.tsx
Outdated
Show resolved
Hide resolved
client/src/ui/organisms/article-actions/language-menu/index.tsx
Outdated
Show resolved
Hide resolved
client/src/ui/organisms/article-actions/language-menu/index.tsx
Outdated
Show resolved
Hide resolved
Bundle StatsHey there, this message comes from a github action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
View detailed bundle breakdownAdded
Removed
Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Co-authored-by: Leo McArdle <leo@mca.is>
2006375
to
5bcbea6
Compare
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.
changes lgtm
Summary
(MP-1242)
Fixes #275.
Fixes #2528.
Fixes #2724.
Fixes #6981.
Problem
en-US
if a page is not available in a locale (including the MDN Curriculum and the MDN Blog), but this means the user has to manually navigate back to their preferred locale.Solution
Reuse the
preferredlocale
cookie that we previously set whenever the user switched the locale in the user interface, but:Caveat: Changing the locale directly in the address bar will still redirect back to the "remembered" language.
How did you test this change?
Ran
npm start
in/cloud-function
, then tested locally withxh
: