nuxt-i18n: 6.15.4
nuxt: 2.14.7
i18n: {
locales: [
{ code: 'ru', iso: 'ru-RU', file: 'ru.js', name: 'Русский' },
{ code: 'en', iso: 'en-US', file: 'en.js', name: 'English' },
{ code: 'de', iso: 'de-DE', file: 'de.js', name: 'Deutsch' }
],
defaultLocale: 'ru',
strategy: 'prefix',
langDir: 'lang/',
lazy: true,
seo: true
}
https://codesandbox.io/s/lively-wave-yqcci?file=/nuxt.config.js
extendRoute in nuxt.config.jsheadAll links in head(i18n-alt-{lang}, i18n-xd, i18n-can) must have slash on the end, because option trailingSlash:true
Pages which added to extendRoute don’t have slash on the end of link
I don't think either Nuxt or this module does any processing (or "auto-fixing") for manually added routes through extendRoutes. You need to make sure yourself that the paths of the added routes already include the trailing slash.
All paths in extendRoutes include the trailing slash.
You need to also add this key to your custom routes:
pathToRegexpOptions: {"strict":true},
This is something that Nuxt is adding automatically when using trailingSlash: true but it doesn't change your custom routes.
You can look into .nuxt/router.js to see how your custom routes differ from auto-generated ones.
Most helpful comment
You need to also add this key to your custom routes:
This is something that Nuxt is adding automatically when using
trailingSlash: truebut it doesn't change your custom routes.You can look into
.nuxt/router.jsto see how your custom routes differ from auto-generated ones.