[Bug] Not working `vueI18n.locale` options
dungsil opened this issue · comments
Project info:
------------------------------
- Operating System: `Windows_NT`
- Node Version: `v17.7.2`
- Nuxt Version: `3.0.0-27460489.53fbca7`
- Package Manager: `pnpm@6.32.2`
- Builder: `vite`
- User Config: `buildModules`, `intlify`
- Runtime Modules: `-`
- Build Modules: `@intlify/nuxt3@0.1.10`
------------------------------
Config:
// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
buildModules: ['@intlify/nuxt3'],
intlify: {
vueI18n: {
localeDir: 'locales',
vueI18n: {
locale: 'en-US',
fallbackLocale: 'en-US',
}
}
}
})
Console log: [intlify] Not found 'meta.title' key in 'en' locale messages.
@dungsil seems you are missing vueI18n.locales
with translations
@dungsil what's the content of that file? Does it have key "meta.title"
? Try to rename that file to en.yml
@dungsil Concerning en-US.yml
and en.yml
check languages of your browser. I guess i18n module takes the preferred language of your browser.
Please elaborate on your last question. I don't understand the problem. I thought your initial question was about error [intlify] Not found 'meta.title' key in 'en' locale messages.
.
How is mutable
connected to that context?
A value of ko
or ko-KR
must be used to work as the browser's default locale. (in my case)
My guess is that this value is probably used as is, not overwritten.
nuxt3/packages/nuxt3/src/runtime/plugin.ts
Lines 26 to 31 in 2df57f6
I am submitting an issue in the nature of a bug report and not a question.
As the title suggests, the vueI18n.locale option does not work.
The option key localeDir
should be outside vueI18n
, at the root of intlify
actually.
export default defineNuxtConfig({
buildModules: ['@intlify/nuxt3'],
intlify: {
localeDir: 'locales',
vueI18n: {
locale: 'en-US',
fallbackLocale: 'en-US',
}
}
})