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

Locale change issue with basePath and localePrefix = 'as-needed' #997

Closed
3 tasks done
SpasiboKojima opened this issue Apr 15, 2024 · 2 comments · Fixed by #999
Closed
3 tasks done

Locale change issue with basePath and localePrefix = 'as-needed' #997

SpasiboKojima opened this issue Apr 15, 2024 · 2 comments · Fixed by #999
Labels
bug Something isn't working

Comments

@SpasiboKojima
Copy link

SpasiboKojima commented Apr 15, 2024

Description

Locale simply doesn't change, seems to be related with the incorrectly applied cookies.
Unfortunately I can't reproduce it in codesandbox, only when running localy. Tried in Chrome and Firefox, shouldn't be exclusive to my setup.
Another way to reproduce it to basically add basePath: '/s', to next.config.js and localePrefix = 'as-needed' to src/config.ts in your examples/example-app-router/.

locale.mp4

Verifications

  • I've verified that the problem I'm experiencing isn't covered in the docs.
  • I've searched for similar, existing issues on GitHub and Stack Overflow.
  • I've compared my app to a working example to look for differences.

Mandatory reproduction URL

https://codesandbox.io/p/github/SpasiboKojima/next-intl-bug-repro-app-router/main

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. Change locale to German, see it set another cookie on / path
  3. Try to change locale back to English

Expected behaviour

Expected it to change locale and probably to not set another cookie

@amannn
Copy link
Owner

amannn commented Apr 17, 2024

Many thanks for the great bug report! This will be fixed in #999.

@amannn amannn removed the unconfirmed Needs triage. label Apr 17, 2024
amannn added a commit that referenced this issue Apr 17, 2024
…le prefix strategy other than `always`. This ensures the locale cookie is set correctly. (#999)

Fixes #997
@SpasiboKojima
Copy link
Author

SpasiboKojima commented Apr 17, 2024

Many thanks for the great bug report! This will be fixed in #999.

Great job, thank you very much!

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
2 participants