nuxt-modules / i18n

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

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

Open zumm opened 4 months ago

zumm commented 4 months 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 4 months 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