0

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.

Gael
  • 1
  • Accordingly to the [documentation](https://v8.i18n.nuxtjs.org/getting-started/setup/#nuxtconfigts), not all the config go in the `i18n.config.js` file. Check my previous [answer](https://stackoverflow.com/a/76542059/11258206) for details. – learntheropes Jul 01 '23 at 15:13

0 Answers0