nuxt-i18n: 6.15.0
nuxt: 2.14.4
i18n: {
strategy: 'prefix',
detectBrowserLanguage: {
useCookie: true,
alwaysRedirect: true,
onlyOnRoot: true
},
}
Demo: http://silent-watch.surge.sh/ru
Github: https://github.com/divine/i18n-static-redirect
It works on CodeSandbox because they don't support static target and runs in dev mode.
When locale is changed cookie is being changed.
However on root path with onlyOnRoot option doesn't redirect based on stored cookie.
When visiting https://silent-watch.surge.sh/ru going back to https://successful-direction.surge.sh should redirect to ru.
Redirection to /en
Right, so it should redirect before updating the cookie in this case.
It's the #805 fix that doesn't play well with the latest changes.
The #805 is creating a redirect route from / to the default locale. I think I can just change that from a redirect route to a normal route. It should still trigger redirect but wouldn't force it to redirect to specific (default) locale.
Fix released in v6.15.1
Most helpful comment
Fix released in v6.15.1