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

Fix Duplicate Language Display on New User Creation #12392

Conversation

sergioosouzaa
Copy link
Contributor

What? Why?

There was a bug in user creation where the Base language was displayed twice. Initially, it was thought that this issue occurred due to having two versions of English in the .env file. However, it happened when a locale other than the base English (such as en_AU) was used. The helper would always append the source_locale (en), resulting in duplication.

This appending behavior (for the source_locale) has been removed, and now it no longer duplicates.

en

What should we test?

Set your .env with somethiing like this:

LOCALE="en_AU"
AVAILABLE_LOCALES="en_AU,fr,es"

  • Visit http://localhost:3000/admin/users/new
  • Check if any languages are duplicated in the language field.

Release notes

Dependencies

Documentation updates

Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Great!

The commit history seems unnecessary bulky though. It says 196 commits for one simple change. I'll go ahead and rebase it for you.

@mkllnk mkllnk force-pushed the fix/duplicate-language-display-new-user-11513 branch from 9460efe to 9477725 Compare April 17, 2024 22:55
@mkllnk
Copy link
Member

mkllnk commented Apr 17, 2024

I ran git rebase -i and removed all unrelated commits.

@rioug rioug added the user facing changes Thes pull requests affect the user experience label Apr 22, 2024
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Looks good 👍 Thanks for your help 🙏

@drummer83 drummer83 self-assigned this Apr 24, 2024
@drummer83 drummer83 added the pr-staged-au staging.openfoodnetwork.org.au label Apr 24, 2024
@drummer83 drummer83 removed their assignment Apr 24, 2024
@drummer83 drummer83 removed the pr-staged-au staging.openfoodnetwork.org.au label Apr 24, 2024
@filipefurtad0 filipefurtad0 self-assigned this Apr 25, 2024
@filipefurtad0 filipefurtad0 added the pr-staged-fr staging.coopcircuits.fr label Apr 25, 2024
@filipefurtad0
Copy link
Contributor

Hey @sergioosouzaa ,

Indeed, this was observable when logged in as an admin (before this PR):

image

After staging your code, we can see the bug is fixed:

image

Tested that the selected language is reflected on the user account, as before.

Thanks for this! Merging.

@filipefurtad0 filipefurtad0 merged commit f269584 into openfoodfoundation:master Apr 25, 2024
55 of 56 checks passed
@filipefurtad0 filipefurtad0 removed the pr-staged-fr staging.coopcircuits.fr label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user facing changes Thes pull requests affect the user experience
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[User->New] Language is displayed twice
5 participants