You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chrome
Version 88.0.4324.104 (Official Build) (64-bit)
What operating system are you using?
Windows
How are you deploying your application?
next build & next start
Describe the Bug
Accept-Language headers of browser are not (correctly) evaluated when directly accessing a sub-page through a deep-link or alike.
Expected Behavior
Accept-Language headers of browser should be evaluated upon first access to the Next.JS application independently of the entry point (root/index or any other sub page)
1.) Deploy above application
2.) Open http://localhost:3000/posts/ssg-ssr (or any other sub-page)
3.) locale within useRouter() should be 'en', but is 'de'
I just identified that this is probably rather a feature request, as the docs limit said behavior to the root page.
When a user visits the application root (generally /), Next.js will try to automatically detect which locale the user prefers based on the Accept-Language header and the current domain.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 28, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Next.js are you using?
10.0.5
What version of Node.js are you using?
14.15.1
What browser are you using?
Chrome
Version 88.0.4324.104 (Official Build) (64-bit)
What operating system are you using?
Windows
How are you deploying your application?
next build & next start
Describe the Bug
Accept-Language headers of browser are not (correctly) evaluated when directly accessing a sub-page through a deep-link or alike.
Expected Behavior
Accept-Language headers of browser should be evaluated upon first access to the Next.JS application independently of the entry point (root/index or any other sub page)
Given
When
Then
To Reproduce
Use example from tutorial:
npx create-next-app nextjs-blog --use-npm --example "https://github.com/vercel/next-learn-starter/tree/master/basics-final"
Remove external data-fetching calls.
Add next.config.js with the following configuration:
Print locale on different pages using
1.) Deploy above application
2.) Open http://localhost:3000/posts/ssg-ssr (or any other sub-page)
3.) locale within useRouter() should be 'en', but is 'de'
Probably a fourth case of #20488
The text was updated successfully, but these errors were encountered: