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

Browser Language Preference Needs To Be Honored #17477

Merged
merged 2 commits into from
Aug 17, 2022
Merged

Conversation

vw98075
Copy link
Contributor

@vw98075 vw98075 commented Jan 3, 2022

Fix #15744


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (below reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@CLAassistant
Copy link

CLAassistant commented Jan 3, 2022

CLA assistant check
All committers have signed the CLA.

@DanielFran DanielFran changed the title 15744 - having the browser language sitting as a part of the displayi… Browser Language Preference Needs To Be Honored Jan 3, 2022
@DanielFran DanielFran marked this pull request as draft January 4, 2022 08:34

<%_ if (enableTranslation) { _%>
findLanguage(): string {
const languageKeys = Object.keys(JSON.parse(JSON.stringify(this.languages)));
Copy link
Member

Choose a reason for hiding this comment

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

why is JSON parse/stringify here, languages is already a proper object

Copy link
Member

Choose a reason for hiding this comment

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

I dont think this is right, with this logic you could end up with wrong versions for many languages, I'll rather do just the below

const currentLanguage = Object.keys(this.languages).includes(navigator.language) ? navigator.language : this.currentLanguage;
this.translationService().refreshTranslation(currentLanguage);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your feedback. I test your code and the outcome is the same for our test cases. I have changed the code in the branch last Friday. I don't know whether that is the right way to update a pull request or not.

@DanielFran DanielFran requested a review from deepu105 January 17, 2022 17:48
Copy link
Member

@deepu105 deepu105 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

@Tcharl
Copy link
Contributor

Tcharl commented Jan 28, 2022

Can you sign the CLA so that we can go further? If you do welcome!

@mraible
Copy link
Contributor

mraible commented Mar 13, 2022

Is this one ready?

@DanielFran
Copy link
Member

@mraible It is, but only for Vue

@Tcharl
Copy link
Contributor

Tcharl commented Mar 14, 2022

There's already many feature gap between frontend: if you agree let's not block single frontend tech feature

@mraible mraible closed this Mar 24, 2022
@mraible mraible reopened this Mar 24, 2022
@mraible
Copy link
Contributor

mraible commented Mar 24, 2022

@vw98075 Is this ready to be merged? If so, please mark it ready for review.

@vw98075
Copy link
Contributor Author

vw98075 commented Mar 25, 2022

@mraible Hi, Matt, I believe that @deepu105 already reviewed it. Not sure about any missing official steps to get this ticket close though.

@mraible
Copy link
Contributor

mraible commented Apr 24, 2022

@vw98075 It looks like the CLA hasn't been signed yet. That's why CI isn't succeeding.

@mraible mraible marked this pull request as ready for review August 17, 2022 08:12
@mraible mraible merged commit 092ff21 into jhipster:main Aug 17, 2022
@DanielFran DanielFran added this to the 7.9.3 milestone Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Browser Language Preference Needs To Be Honored
6 participants