I'd like to redirect from /my-account to /hr/moj-racun using nuxt i18n (because Croatian is the default language, and the mapping between my-account and moj-racun exists).
Instead it redirects to /hr/my-account.
The page folder inside my nuxt app folder is named 'my-account', and this is my current setup:
(I've set the alwaysRedirect, but it takes the entered url and prepends the language prefix, but it does not translate it by the given mapping)
[
'nuxt-i18n',
{
locales: [
{
name: 'Hrvatski',
code: 'hr',
iso: 'hr-HR',
file: 'hr.js'
},
{
name: 'English',
code: 'en',
iso: 'en-US',
file: 'en.js'
}
],
langDir: 'locales/',
strategy: 'prefix',
defaultLocale: 'hr',
lazy: true,
detectBrowserLanguage: false
}
]
Edit, this is my-account page specific nuxt-i18n setup:
export default {
nuxtI18n: {
paths: {
en: '/my-account',
hr: '/moj-racun'
}
}
}
If I go to the page like http://example.com/my-account it gets redirected to http://example.com/**hr**/my-account, without translation.