We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
- Operating System: Darwin - Node Version: v22.3.0 - Nuxt Version: 3.12.4 - CLI Version: 3.12.0 - Nitro Version: 2.9.7 - Package Manager: [email protected] - Builder: - - User Config: compatibilityDate, runtimeConfig, srcDir, dir, app, css, modules, i18n, vite - Runtime Modules: @nuxtjs/[email protected], @nuxtjs/[email protected] - Build Modules: -
Hi!
When using the prefix_and_default strategy and the detectBrowserLanguage option, the redirect logic is unclear.
prefix_and_default
detectBrowserLanguage
Current behavior:
site.com/ → click NL → site.com/nl → change url manually to site.com/ → get site.com/nl
site.com/
NL
site.com/nl
What I expected from the parameter alwaysRedirect: false:
alwaysRedirect: false
site.com/ → click NL → site.com/nl → change url manually to site.com/ → get site.com/
Am I doing something wrong? Is there any way to fix this in nuxt.config.ts?
// nuxt.config.ts i18n: { vueI18n: '~/app/i18n/i18n.config.ts', baseUrl: process.env.BASE_URL, locales: [ { code: 'en', iso: 'en-US', name: 'English' }, { code: 'nl', iso: 'nl-NL', name: 'Nederlands' } ], defaultLocale: 'en', strategy: 'prefix_and_default', detectBrowserLanguage: { fallbackLocale: 'en', useCookie: true, cookieKey: 'lang', alwaysRedirect: false, redirectOn: 'all' } } // i18n.config.ts import en from './locales/en.json' import nl from './locales/nl.json' export default defineI18nConfig(() => ({ legacy: false, locale: 'en', fallbackLocale: 'en', globalInjection: true, messages: { en, nl }, missingWarn: false, fallbackWarn: false, }))
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
Reproduction
Describe the bug
Hi!
When using the
prefix_and_default
strategy and thedetectBrowserLanguage
option, the redirect logic is unclear.Current behavior:
site.com/
→ clickNL
→site.com/nl
→ change url manually tosite.com/
→ getsite.com/nl
What I expected from the parameter
alwaysRedirect: false
:site.com/
→ clickNL
→site.com/nl
→ change url manually tosite.com/
→ getsite.com/
Am I doing something wrong? Is there any way to fix this in nuxt.config.ts?
Additional context
Logs
No response
The text was updated successfully, but these errors were encountered: