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

Remember to use language choice between browser sessions #675

Merged

Conversation

tjementum
Copy link
Member

@tjementum tjementum commented Jan 14, 2025

Summary & Motivation

Ensure that a user's language selection is saved in the browser, so the same language is used when they sign out or later return. If an anonymous user changes the language while signing up, the created user will have the selected language set. Maintain the logic that sets the language to match the user's profile language upon signing in.

This is achieved by saving the preferred language in the browser storage. Additionally, the CreateUser and CompleteSignup endpoints have been extended to include language preferences, ensuring that language settings are properly stored during user creation and signup completion.

Downstream projects

Please update the /WebApp/routes/__root.tsx file to initialize the correct locale.

import { useInitializeLocale } from "@repo/infrastructure/translations/useInitializeLocale";


function Root() {
  const navigate = useNavigate();
  useInitializeLocale(); // Add this line

  return ( ... )
}
  • I have added tests, or done manual regression tests
  • I have updated the documentation, if necessary

Copy link

linear bot commented Jan 14, 2025

@tjementum tjementum self-assigned this Jan 14, 2025
@tjementum tjementum added the Enhancement New feature or request label Jan 14, 2025
@tjementum tjementum force-pushed the pp-307-remember-to-use-language-choice-between-browser-sessions branch from b564c3c to f79d9c7 Compare January 14, 2025 22:58
@tjementum tjementum force-pushed the pp-307-remember-to-use-language-choice-between-browser-sessions branch from f79d9c7 to 889d0af Compare January 14, 2025 23:30
@tjementum tjementum merged commit 9bbb91b into main Jan 14, 2025
12 checks passed
@tjementum tjementum deleted the pp-307-remember-to-use-language-choice-between-browser-sessions branch January 14, 2025 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant