I18n-module: Structure subpages/children - custom paths - Nuxt-i18n - url deleted

Created on 30 Apr 2019  路  3Comments  路  Source: nuxt-community/i18n-module

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:

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:

I try to follow this: https://nuxt-community.github.io/nuxt-i18n/routing.html#custom-paths

Please, 驴Any help?

This question is available on Nuxt community (#c232)

Most helpful comment

Try with localePath('test-dt') or look into .nuxt/router.js where all your routes are registered

All 3 comments

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!!! :-)

Was this page helpful?
0 / 5 - 0 ratings