Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overridden locale domains don't switch locale #2931

Open
CernyMatej opened this issue Apr 22, 2024 · 0 comments
Open

Overridden locale domains don't switch locale #2931

CernyMatej opened this issue Apr 22, 2024 · 0 comments

Comments

@CernyMatej
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v20.9.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools, modules, i18n
  • Runtime Modules: @nuxtjs/[email protected]
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-dx8kkg?file=nuxt.config.ts

The reproduction will not work on stackblitz due to using the custom domains. Please clone it & test locally.

Describe the bug

The documentation says:

Alternatively, to avoid the need for multiple builds, the locale domains can be overridden via runtime environment variables. The variable name should follow the format NUXT_PUBLIC_I18N_LOCALES_{locale code}_DOMAIN

However, based on my testing, this doesn't seem to work. The domains provided through .env do appear in the lang switcher (result of switchLocalePath() call), however, they don't switch the locale.

I'm not sure if I'm just doing something wrong or if this is a bug, but regardless, this issue either needs fixing or the documentation needs to be updated. I'd be happy to update the docs if necessary.

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant