nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.65k stars 465 forks source link

Cookie based locale detection is not respected in ssg mode #2996

Open zumm opened 5 days ago

zumm commented 5 days ago

Environment


Reproduction

https://stackblitz.com/edit/nuxt-starter-bnxebz?file=app.vue

npm run generate npx serve .output/public

Change locale by pressing button and reload page. Locale resets to default.

Describe the bug

When using cookie based locale detection (cookie + no prefix strategy) and ssg at same time cookie is not respected. Everything works fine in not ssg mode tho.

Additional context

No response

Logs

No response

zumm commented 3 days ago

Mb i could pr, but i need some guidance. I don't really understand why ssg needs special treatment in detectBrowserLanguage in first place. @kazupon