TT
TT
NNuxt
Created by TT on 4/17/2024 in #❓・help
Reserved Keywords in i18n ?
Hello, I'm using Nuxt 2.15 with Vue2 in a bit old project, and I'm finding an issue with my i18n plugin, my config look like that :
i18n: {
locales: [
{ code: 'en', iso: 'en', name: 'English', file: 'en.js', dir: 'ltr' },
{ code: 'fr', iso: 'fr', name: 'Français', file: 'fr.js', dir: 'ltr' },
{ code: 'deutsch', iso: 'de', name: 'Deutsch', file: 'de.js', dir: 'ltr' },
],
defaultLocale: 'fr',
strategy: 'prefix_except_default',
lazy: true,
langDir: './lang',
vueI18n: {
fallbackLocale: 'fr',
},
},
i18n: {
locales: [
{ code: 'en', iso: 'en', name: 'English', file: 'en.js', dir: 'ltr' },
{ code: 'fr', iso: 'fr', name: 'Français', file: 'fr.js', dir: 'ltr' },
{ code: 'deutsch', iso: 'de', name: 'Deutsch', file: 'de.js', dir: 'ltr' },
],
defaultLocale: 'fr',
strategy: 'prefix_except_default',
lazy: true,
langDir: './lang',
vueI18n: {
fallbackLocale: 'fr',
},
},
Everythings work well with this configuration for German language but when I set the normal code 'de' it doesnt work for all my pages that start with de, for example /deals /deals/:id etc.. It goes to my fallback which is french. If I switch the language directly from this page, it works correctly but when I'm navigating to it it just fallback and go /deals instead of /de/deals. I don't have any /de files that might conflict, I'm a bit new to Nuxt so maybe I missed something ? Thanks
9 replies