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: save language selection as cookie #1447

Merged
merged 8 commits into from
Sep 8, 2023

Conversation

SGrueber
Copy link
Collaborator

@SGrueber SGrueber commented Jun 9, 2023

PR Type

[x] Feature

What Is the Current Behavior?

The pwa is always opened in the requested language according to the url/default language.

Issue Number: Closes #1489

What Is the New Behavior?

If the user changes the language the new language is saved as cookie 'preferredLocale' in the browser. The next time he/she opens the pwa the pwa is reloaded in this language if it differs from the current language and this language is supported by the PWA. This cookie is considered as a technically necessary cookie and will be set even if the user only accepts necessary cookies.
This feature is enabled by default and can be disabled by switching the feature toggle 'saveLanguageSelection' off.

Does this PR Introduce a Breaking Change?

[ ] Yes
[x] No

Other Information

AB#86776

@github-actions
Copy link

Azure Demo Servers are available:

@SGrueber SGrueber force-pushed the feature/preferred_locale_cookie branch from 87fd6b4 to 41a8790 Compare June 13, 2023 08:52
@github-actions
Copy link

Azure Demo Servers are available:

@SGrueber SGrueber force-pushed the feature/preferred_locale_cookie branch from 41a8790 to 5ec1e6f Compare June 13, 2023 13:24
@github-actions
Copy link

Azure Demo Servers are available:

@SGrueber SGrueber force-pushed the feature/preferred_locale_cookie branch from 2a8400d to d4aa83a Compare June 19, 2023 07:05
@SGrueber SGrueber requested a review from Eisie96 June 19, 2023 08:33
@SGrueber SGrueber added the feature New feature or request label Jun 19, 2023
@SGrueber SGrueber added this to the 4.2 milestone Jun 19, 2023
@SGrueber SGrueber force-pushed the feature/preferred_locale_cookie branch 2 times, most recently from 3777e44 to b474698 Compare June 19, 2023 10:58
@Eisie96
Copy link
Contributor

Eisie96 commented Jun 19, 2023

It doesn't work, when the PWA is running locally with ng serve in production mode. The PWA will run into an infinite loop, where the lang parameter has been appended to the existing one. Happens only, when the locale cookie is set. - Obsolete

@SGrueber SGrueber marked this pull request as ready for review June 23, 2023 09:46
@SGrueber SGrueber force-pushed the feature/preferred_locale_cookie branch 4 times, most recently from 3facd2f to ebb6420 Compare June 26, 2023 13:12
@github-actions
Copy link

Azure Demo Servers are available:

@SGrueber SGrueber requested a review from shauke June 26, 2023 15:04
@SGrueber SGrueber added the wait Waiting for something (e.g. new ICM release) label Jul 4, 2023
@Eisie96
Copy link
Contributor

Eisie96 commented Jul 4, 2023

Please check, when applying the preferred locale, that the locale is available. The problem can occur, when the Multi-Channel configuration contains different channel for different paths. - Done

@SGrueber
Copy link
Collaborator Author

SGrueber commented Aug 30, 2023

add a feature toggle to switch the behavior on/off - Done

@SGrueber SGrueber removed the wait Waiting for something (e.g. new ICM release) label Aug 31, 2023
@github-actions
Copy link

github-actions bot commented Sep 1, 2023

Azure Demo Servers are available:

@SGrueber SGrueber force-pushed the feature/preferred_locale_cookie branch from 792ffcc to cc4d110 Compare September 5, 2023 14:12
@SGrueber SGrueber force-pushed the feature/preferred_locale_cookie branch from cc4d110 to f357086 Compare September 6, 2023 09:06
shauke
shauke previously approved these changes Sep 8, 2023
@shauke shauke merged commit c2e43bb into develop Sep 8, 2023
@shauke shauke deleted the feature/preferred_locale_cookie branch September 8, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch language after accepting cookies
3 participants