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

Bug 1924188: Update language selector modal dropdown #8009

Merged

Conversation

rebeccaalpert
Copy link
Contributor

@rebeccaalpert rebeccaalpert commented Feb 1, 2021

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)
Screen Shot 2021-02-01 at 2 31 20 PM

es (new behavior - example of language we don't support)
Screen Shot 2021-02-01 at 2 34 08 PM

zh (existing behavior still works)
Screen Shot 2021-02-01 at 2 33 44 PM

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.

@rebeccaalpert rebeccaalpert added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 1, 2021
@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label Feb 1, 2021
@rebeccaalpert rebeccaalpert changed the title Update language modal Update language modal dropdown Feb 1, 2021
@rhamilto
Copy link
Member

rhamilto commented Feb 1, 2021

Tested and this makes sense to me. Will wait for @spadgett's input.

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
@rebeccaalpert rebeccaalpert changed the title Update language modal dropdown Bug 1924188: Update language selector modal dropdown Feb 2, 2021
@openshift-ci-robot
Copy link
Contributor

@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
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1924188: Update language selector modal dropdown

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.

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Feb 2, 2021
@openshift-ci-robot
Copy link
Contributor

@rebeccaalpert: This pull request references Bugzilla bug 1924188, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1924188: Update language selector modal dropdown

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 rebeccaalpert removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 2, 2021
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2021
@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 2, 2021
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit cf05b61 into openshift:master Feb 2, 2021
@openshift-ci-robot
Copy link
Contributor

@rebeccaalpert: All pull requests linked via external trackers have merged:

Bugzilla bug 1924188 has been moved to the MODIFIED state.

In response to this:

Bug 1924188: Update language selector modal dropdown

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.

@spadgett spadgett added this to the v4.7 milestone Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants