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

Feat/users/994 one language call to rule them all #1005

Merged
merged 13 commits into from
Aug 12, 2024

Conversation

sonwit
Copy link
Contributor

@sonwit sonwit commented Aug 9, 2024

Get the user's selected language from the cookie instead of the user profile.

Description

  • Rename "ProfileHelper" to "LanguageHelper."
  • Stop getting the language from the user profile if not necessary.
  • Continue getting the language from "altinnPersistentContext" in HomeController, and from the Profile if it doesn't exist; otherwise, use the cookie from the frontend.
  • Rename the "i18next" cookie to "selectedLanguage" and use this in the frontend for loading the language.
  • Simplify the mapping of languages between standards.

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@sonwit sonwit requested a review from allinox August 9, 2024 11:06
@github-actions github-actions bot added the kind/feature-request Used when issue is a new feature or request label Aug 9, 2024
Copy link
Contributor

@allinox allinox left a comment

Choose a reason for hiding this comment

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

This looks great! 😄
I like what you've done with the LanguageHelper - so useful!
Thanks for fixing up in the language stuff. It's way more robust now!

There are a few sonarcloud warnings I see have popped up in github telling us to use List.Find instead of IEnumerable.FirstOrDefault which you can consider changing if you have the time, but it's nothing major so not super important to do right this second I think.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
64.29% Condition Coverage on New Code (required ≥ 65%)

See analysis details on SonarCloud

@sonwit sonwit merged commit 59053c9 into main Aug 12, 2024
7 of 8 checks passed
@sonwit sonwit deleted the feat/users/994-One-language-call-to-rule-them-all branch August 12, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request Used when issue is a new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants