The first time you enter the URL page of the specified language, nuxt-i18n triggers HTTP status code 302
See original GitHub issueVersion
nuxt-i18n: ^6.15.4 nuxt: ^2.14.6
Nuxt configuration
mode:
- universal
- [] spa
Nuxt-i18n configuration
i18n: {
locales: [{
code: 'en',
iso: 'en-US',
name: 'English'
},
{
code: 'zh',
iso: 'zh-ZH',
name: '中文'
}
],
defaultLocale: 'zh',
vueI18n: {
fallbackLocale: 'zh',
messages: {
en: Object.assign(langEn, require('./lang/en')),
zh: Object.assign(langZhCN, require('./lang/zh'))
}
}
}
When I enter the page for the first time, I assume that the address I visited is http://localhost:3000/en/demo
;
nuxt-i18n It will trigger automatically HTTP status code 302 Get to this page http://localhost:3000/demo
;
This page is my default language page;
I found that it might be cookie Among them i18n_redirected
problem,If i18n_redirected exists, I will be able to access normally. If not, 302 will be triggered
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Redirecting to the same page but switched language url ...
You can see I am passing in the locale argument which is the language code that was choosen and we use the $nuxt.$router...
Read more >How to redirect the index / after setting noPrefixDefaultLocale
Hello, i have problem: i set noPrefixDefaultLocale to false in the description: By default, paths generated for the default language don't ...
Read more >Options - i18n-module
Here are all the options available when configuring the module and their default values:
Read more >Language Aware Nuxt.js Routing - Abdelrahman Awad
The problem is if we just exclude the current locale from the localization logic, it prevents us from using URLs with different language...
Read more >Changelog - Cypress Documentation
Component Testing is now generally available for projects using React, Next.js, Angular, and Vue! Component tests allow you to see and test your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is so cool, it seems to solve my problem perfectly, thank you very much
Try enabling
onlyOnRoot
option indetectBrowserLanguage
https://i18n.nuxtjs.org/options-reference#detectbrowserlanguage .It will become enabled by-default in the future but for now, it’s recommended to set it manually.