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

navigateTo without locale prefix resets locale to default #3041

Open
goela268 opened this issue Jul 25, 2024 · 1 comment
Open

navigateTo without locale prefix resets locale to default #3041

goela268 opened this issue Jul 25, 2024 · 1 comment

Comments

@goela268
Copy link

goela268 commented Jul 25, 2024

Environment


  • Operating System: Linux
  • Node Version: v21.6.2
  • Nuxt Version: 3.12.3
  • CLI Version: 3.12.0
  • Nitro Version: 2.9.7
  • Package Manager: npm@10.2.4
  • Builder: -
  • User Config: compatibilityDate, devtools, runtimeConfig, imports, colorMode, ogImage, components, sanctum, router, i18n, ui, cookieControl, modules, googleFonts
  • Runtime Modules: @nuxt/ui@2.18.1, @nuxtjs/google-fonts@3.2.0, @nuxtjs/i18n@8.3.1, @pinia/nuxt@0.5.1, @vueuse/nuxt@10.11.0, nuxt-auth-sanctum@0.4.2, @dargmuesli/nuxt-cookie-control@8.4.5, @nuxtjs/seo@2.0.0-rc.16
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-v5tzb6?file=app.vue

Describe the bug

If you navigate to a different page using navigateTo the selected locale is ALWAYS reset to defaultLocale.
Example: You get redirected `example.com/' (no prefix). Language is reset to the default one.

However, if you are currently on example.com/nl, and navigate to example.com by adjusting the url (so essentially removing the prefix), the selected language is kept, as I would expect.

Additional context

No response

Logs

No response

@BobbieGoede
Copy link
Collaborator

However, if you are currently on example.com/nl, and navigate to example.com by adjusting the url (so essentially removing the prefix), the selected language is kept, as I would expect.

I don't understand, are you saying you expect example.com to show nl translations when navigating to it from example.com/nl?

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

2 participants