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
Bug 1924188: Update language selector modal dropdown #8009
Bug 1924188: Update language selector modal dropdown #8009
Conversation
e5db2b3
to
7bee1f8
Compare
Tested and this makes sense to me. Will wait for @spadgett's input. |
frontend/public/components/modals/language-preferences-modal.tsx
Outdated
Show resolved
Hide resolved
Language selector dropdown should now pre-select the language in a wider range of cases. The selector previously only pre-selected English, Chinese, or Japanese if the browser language was set to en, zh, or ja exactly. The logic should now handle languages we don't support, as well as subsets of languages, such as en-us. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1924188
7bee1f8
to
02c622f
Compare
@rebeccaalpert: This pull request references Bugzilla bug 1924188, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@rebeccaalpert: This pull request references Bugzilla bug 1924188, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rebeccaalpert, spadgett The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
@rebeccaalpert: All pull requests linked via external trackers have merged: Bugzilla bug 1924188 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This was a quick tech-check for Megan Hall on a usability bug. The language selector dropdown now pre-selects the language. This previously only worked if the user was using zh, en, or ja exactly. It can now handle unsupported languages and subsets of languages we support, such as en-us and zh-cn.
en-US (new behavior - example of subset of language)
es (new behavior - example of language we don't support)
zh (existing behavior still works)
I had to use i18next.languages since i18next.language and i18n.language.lang will return the detected language regardless of whether we support it. From the docs, i18next.languages is set to an array of language codes that will be used to look up the translation value. When the language is set, this array is populated with the new language codes. Unless overridden, this array is populated with less-specific versions of that code for fallback purposes, followed by the list of fallback languages. I filtered i18next.languages against our supported list of languages to get the correct display language.
CC @rhamilto @spadgett. Are you guys ok with this approach? Let me know if you have thoughts.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1924188.