0

Hello I have a problem with next-i18next in NextJS. When I switch to cs locale and refresh the page the page switch locale back to en. I have Chrome default language set to English though. But shouldnt it works just fine when I want to browse the page in Czech language?

I'm adding codesandbox to replicate the issue. https://codesandbox.io/s/musing-glitter-o3xsjl?file=/pages/_app.tsx

I was following the offical guide from next-i18next with this example which is working fine

https://next.i18next.com/

https://github.com/i18next/next-i18next

  • Does it work with a link component? – adrai Jul 18 '22 at 21:06
  • – adrai Jul 18 '22 at 21:06
  • Unfortunately it still has same behaviour with next/link – Richard Biroš Jul 19 '22 at 06:39
  • 1
    Tried your example and it seems to behave correctly. If your Accept-Language header contains en somewhere and not cs, it will show english... like described here: https://nextjs.org/docs/advanced-features/i18n-routing#automatic-locale-detection – adrai Jul 19 '22 at 08:17
  • Next.js automatically detects which locale to use based on the `Accept-Language` header. You can disable this by setting `localeDetection` to `false` in your config file. See [defaultLocale is not keeping default lang in Next.js i18n](https://stackoverflow.com/questions/66730980/defaultlocale-is-not-keeping-default-lang-in-next-js-i18n). – juliomalves Jul 19 '22 at 20:56

0 Answers0