i18n icon indicating copy to clipboard operation
i18n copied to clipboard

Cookie based locale detection is not respected in ssg mode

Open zumm opened this issue 1 year ago • 1 comments

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

zumm avatar Jun 26 '24 16:06 zumm

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

zumm avatar Jun 28 '24 05:06 zumm