Skip to content

Set the current language on the localization provider #957

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

Merged
merged 1 commit into from
Apr 15, 2022

Conversation

AlbyIanna
Copy link
Contributor

Motivation

The English language gets forgotten when changing the language.
Solves #956

Change description

Set the language to the localization provider

Other information

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@AlbyIanna AlbyIanna requested a review from per1234 April 15, 2022 07:51
@per1234 per1234 linked an issue Apr 15, 2022 that may be closed by this pull request
3 tasks
Comment on lines 284 to 286
if (currentLanguage === 'en') {
window.localStorage.removeItem(nls.localeId);
} else {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kittaakos do you think it's necessary to save the locale id to the local storage like this in order for the localization to work?

I thought that setting the current language to the localization provider was enough, so I've tried removing this code, but then the localization didn't work correctly, therefore it appears it is not enough.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

This solves #956 for me.
Thanks Alberto!

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Apr 15, 2022
@AlbyIanna AlbyIanna merged commit a44b84f into main Apr 15, 2022
@AlbyIanna AlbyIanna deleted the fix-forgotten-language-preference branch April 15, 2022 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

English "Language" preference selection is forgotten
2 participants