The locale doesn't change for pages other than index page
I tried using next-translate v1.0.7 Using the sub path /ja
it works for index page localhost:3000/ja, but not working when navigating to other page, it keeps returning to default en locale localhost:3000/ja/product/detail
ready - started server on http://localhost:3000
next-translate - compiled page: /product/detail - locale: en - namespaces: common - used loader: getInitialProps
next-translate - compiled page: / - locale: ja - namespaces: common - used loader: getStaticProps
You need to update to the last version of Next.js. Should be fixed after this PR https://github.com/vercel/next.js/pull/21930.
Try Next.js 10.2.3 😊
I too have this issue, even after updating to latest version of react, and next-translate.
Upgrade to nextjs 10.2.3 solved my issue
@Gyaniultimate after migrate Next.js solve it?
@aralroca I have a same issue but upgrade next.js to 10 cannot solve it.
The locale language can only be detected when I entered the website for the first time. When the page changed by using Router.push, the locale language keep showing the defaultLocale that sets in config file.
Also, I tried to set NEXT_LOCALE into cookie, the value is correct but the pages keep getting the wrong defaultLocale.
@peggy1000423 can try to use specifically this version 10.2.3
I'm experiencing the same issue with next 12.0.7 and next-translate 1.2.0. For the index page the browser gets redirected to the correct locale prefix. For subpages this does not happen.
Update:
defaultLocale: "en" Browser-Language: "de"
- domain.tld --- redirects to ---> domain.tld/de
- domain.tld/imprint delivers version with default locale
Check if you are using Link from next/link. I had the same problem but it was using link from Material Ui which overrides locales.
This still seems to be an issue in v12.1.4
Any news of this? I can confirm that the issue is there in the latest version of NextJS. If I directly go to a particular route, it does not redirect to the specific locale page but rather go to the page for the default locale. I tried to play around with the middleware but that is no help either as the request object does any information on the right locale. It would be great if you could at least provide a direction how to fix this issue in case the bug is not already fixed.
Thanks a lot in advance.
With NextJS 13, my middleware works fine under development environment while not trigger at all under production environment...
Still have this issue under dev environment with NEXT_LOCALE set. Package versions:
├── [email protected]
├── [email protected]
Did anyone figure out how to fix this? I'm having the same issue