Structure subpages/children - custom paths - Nuxt-i18n - url deleted
Good Morning,
When I generate subpages in my structure it doesn't generate the link to my url and appears a vue-router error. Any help?
package.json "nuxt-i18n": "^5.10.0",
I have this sample structure pages:
pages
- test/ -- index.vue --dt/ ---index.vue
In my configuration I have this:
const I18N = { vueI18nLoader: true, locales: [ { code: 'en', name: 'English', iso: 'en-US', file: 'en-US.js', flag: '/EN-flag.png' }, { code: 'es', name: 'Español', iso: 'es-ES', file: 'es-ES.js', flag: '/ES-flag.png' } ], defaultLocale: 'es', fallbackLocale: 'es', lazy: true, langDir: 'lang/', strategy: 'prefix_except_default', detectBrowserLanguage: { useCookie: true, cookieKey: 'i18n_redirected', alwaysRedirect: false }, baseUrl: 'https://domain', seo: false, parsePages: false, // Disable acorn parsing pages: {
test: { en: '/test', es: '/prueba' }, 'test/dt/index': { en: '/test/dt', es: '/prueba/dt' } ... }
in my view the link to my subpage: <v-list-tile router :to="localePath('test/dt/index')"
this is my error, and it doesn't generate any link: WARN [vue-router] Route with name 'test/dt/index___es' does not exist
Instead when I link to the parent this is OK: <v-list-tile router :to="localePath('test')"
I try to follow this: https://nuxt-community.github.io/nuxt-i18n/routing.html#custom-paths
Please, ¿Any help?
This issue as been imported as question since it does not respect nuxt-i18n issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/nuxt-i18n/issues/c232.
Try with localePath('test-dt') or look into .nuxt/router.js where all your routes are registered
Thanks @ValentinCrochemore !!! with localePath('test-dt') it goes OK!!! :-)