next-i18next: Auto defining fallbackLng in production build breaks v4.5

Describe the bug

Since this change of i18next v19.8.5 & the default config of next-i18next v4.5.0 in prod build it is not able to “stay” in the secondary language, SSR renders the secondary language but at client side, it changes to fallbackLng which is the defaultLanguage (which is the primary language)

Occurs in next-i18next version

v4.5.0

I’m not able to update to latest since my app uses custom server not just for translations

Steps to reproduce

  1. clone https://github.com/felixmosh/next-i18next-bug-fallbackLng
  2. yarn install
  3. yarn build
  4. yarn start
  5. open http://localhost:3000
  6. change to de (check that there is de subpath)
  7. reload the page
  8. the page shows in english

Expected behaviour

After reloading the page, it should remain on the Dutch lang

Additional context

It is not possible to turnoff this fallbackLng behavior since the fix is not available in v4.5.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

Yep, as I said, I’ll merge it if you want to do the work!