i18n
i18n copied to clipboard
Cookie based locale detection is not respected in ssg mode
Environment
- Operating System: Windows_NT
- Node Version: v18.16.0
- Nuxt Version: 3.12.2
- CLI Version: 3.12.0
- Nitro Version: 2.9.6
- Package Manager: [email protected]
- Builder: -
- User Config: css, ssr, app, devtools, runtimeConfig, build, vite, modules, imports, plugins, sourcemap
- Runtime Modules: @pinia/[email protected], [email protected], (), @nuxtjs/[email protected]
- Build Modules: -
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
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