vuetify-nuxt-module
vuetify-nuxt-module copied to clipboard
i18n key not found in locale messages
After following documentation for basic setup of i18n with lazy loading of locales from files, I get this error on the initial render:
[intlify] Not found 'welcome' key in 'en' locale messages.
Reproduction:
https://stackblitz.com/edit/github-6zjd6y?file=app.vue,nuxt.config.ts,package.json,lang%2Fen-US.json,i18n.config.ts
Is this a bug, or am I just doing something wrong? I have checked the playground, and things seem to be working there, but I can't figure out what is different there vs my code.
To access message using Vuetify $t you need to prefix the key with $vuetify.: $t('$vuetify.welcome')
Hm, that didn't seem to do anything. It doesn't seem to work without vuetify-nuxt-module either, so must be something wrong with @nuxtjs/i18n? https://stackblitz.com/edit/github-coadyf?file=i18n.config.ts,nuxt.config.ts,app.vue,lang%2Fes-ES.json,package.json
Spomething to do with this maybe? https://github.com/nuxt-modules/i18n/issues/2192
i18n module version? I'll try to figure out what's happening...
Using rc 2. Have also tried beta 13, with no luck. Thanks 🙏
@AasmundN It is weird, your repro working, check my fork here: https://stackblitz.com/edit/github-6zjd6y-eqyxxp?file=.npmrc
I've only change the package manager adding .npmrc
Hmm, yes your fork works. Weird. Maybe it's some sort of problem with npm? However, when I add another locale and corresponding file and then set that as the default locale it stops working again: https://stackblitz.com/edit/github-6zjd6y-axgyjt?file=i18n.config.ts,app.vue
I get an error in the console: [Vue warn]: Hydration text mismatch
And if I don't set the second locale as the default one, the second locale is not loaded properly: https://stackblitz.com/edit/github-6zjd6y-xfkw7g?file=i18n.config.ts,nuxt.config.ts
If lazy is set to false it seems to work.
https://github.com/nuxt-modules/i18n/issues/2300