Open simoroma opened 1 year ago
Probably because the name of your page (terms-fi.vue
) is equal to the path you provide via the pages
config (/terms-fi
).
Why do you have two pages for terms? What do you want to achieve?
Thanks for the reply. I am trying to get something similar to this: https://i18n.nuxtjs.org/custom-paths/ It is just more convenient to have two pages for terms because they have some paragraphs and I don't want to define many variables and get translations for each variable via $t
.
I tried different variations of this. I still have the same issue with:
customRoutes: 'config', // disable custom route with page components
pages: {
terms: {
en: '/terms',
fi: '/terms-fi',
},
},
I don't think you can achieve that with nuxt-i18n (easily). The customs paths are meant to provide the paths to one single page.
It's actually quite common to have a lot of translated paragraphs (respectively variables) in pages. Maybe the tooling around vue-i18n over at https://kazupon.github.io/vue-i18n/guide/tooling.html can help you translate/work faster? I am using https://www.codeandweb.com/babeledit and https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally to speed things up.
Cool stuff. I might try to use them then.
I wanted to have two template files so I could send them to the website owner: eg terms-en.vue
and terms-fi.vue
. Then they would do the translations.
BabelEdit can read your vue-i18n language files and export them to a CSV file. Hand it over to your client and import it again when they are finished translating. This is a quite convenient workflow, we have used them in several Nuxt (2) projects.
Environment
"@nuxtjs/i18n": "^8.0.0-beta.10",
Reproduction
I have the following pages:
terms.vue
terms-fi.vue
and my
nuxt.config.ts
has the following:It works correctly when going from Finnish to English. Though when I am at
/fi/terms-fi
(the Finnish page) and I switch to english withswitchLocalePath
the routes becomesterms-fi
and it should just beterms
Describe the bug
Error in the route when switching language if custom pages are defined.
Additional context
No response
Logs
No response