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

Switch language after accepting cookies #1489

Closed
ximfritz opened this issue Aug 22, 2023 · 1 comment · Fixed by #1447
Closed

Switch language after accepting cookies #1489

ximfritz opened this issue Aug 22, 2023 · 1 comment · Fixed by #1447
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ximfritz
Copy link

ximfritz commented Aug 22, 2023

Actual Behavior

  1. Open https://intershoppwa.azurewebsites.net/home
  2. Switch language to DE
  3. Site switched to DE
  4. Accept all cookies
  5. Site switches to EN

Expected Behavior

  1. Open https://intershoppwa.azurewebsites.net/home
  2. Switch language to DE
  3. Site switched to DE
  4. Accept all cookies
  5. Site stays on DE

Steps to Reproduce the Bug

Take a look at actual behavior

Environment Details

  • Desktop: *

    • OS: [e.g. iOS]
    • Browser Firefox
    • Project Code Version
  • Smartphone: *

    • Device: [e.g. iPhone6]
    • OS: [e.g. iOS8.1]
    • Browser [e.g. stock browser, safari], Version [e.g. 22]
    • Project Code Version

Additional Context, like Screenshots, Log File Snippets etc.

Video of the problem

language-switch-problem.mp4

AB#88811

@ximfritz ximfritz added the bug Something isn't working label Aug 22, 2023
@Eisie96 Eisie96 self-assigned this Aug 23, 2023
@Eisie96
Copy link
Contributor

Eisie96 commented Aug 23, 2023

This problem is known. With ng serve the language can only be set via an url parameter. When the page should be reloaded, the language parameter has been disappeared and the default language is used again.

To avoid the problem a MULTI_CHANNEL configuration can be applied. With that it is possible to add the language information to the url path.

e.g.

MULTI_CHANNEL: |
        .+:
          - baseHref: /en
            channel: default
            lang: en_US

There is an open PR (#1447), which adds a 'preferredLocale' cookie, whenever the language is changed. This cookie is then considered everytime the PWA reloads. This will solve this issue too. But be aware that there are still some problems, why the PR is not yet merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants