I use next3js and i try to configure i18n. It's working when i use local messages.
messages: {
en: {
welcome: 'Welcome'
},
fr: {
welcome: 'Bienvenue'
}
}
Now I want layer for have fr.json and en-US.json. But I have this error.
[intlify] Not found 'welcome' key in 'en' locale messages. 20:54:32
[intlify] Not found 'welcome' key in 'en-US' locale messages. 21:33:23
[intlify] Fall back to translate 'welcome' key with 'en' locale. 21:33:23
[intlify] Not found 'welcome' key in 'en' locale messages. 21:33:23
[intlify] Not found 'welcome' key in 'en-US' locale messages. 21:33:23
[intlify] Fall back to translate 'welcome' key with 'en' locale. 21:33:23
[intlify] Not found 'welcome' key in 'en' locale messages.
This is my config file:
export default defineI18nConfig(() => ({
legacy: false,
defaultLocale: 'fr',
lazy: true,
langDir: 'lang/',
locales: [
{
code: 'fr',
iso: 'fr-FR',
file: 'fr.json'
},
{
code: 'en-US',
iso: 'en-US',
file: 'en-US.json'
}
]
}))
And i have create file lang/fr.json and en-US.json.
{
"welcome": "chocolate"
}
I try so many config Can you help pls ?
I follow this documentation text And so many forum on the web, but I can't resolved this.