martinkr/next-export-i18n

Invaild default language 'en'.

Orinameh opened this issue · 4 comments

Hello, thank you for this library. However, I keep getting Invalid default language 'en1 error message. My index.js in i18n folder is

  const i18n = {
   translations: {
    en: en.i18n
   },
  defaultLang: "en"
}

Please, help

Ho Orinameh,

thank you for reaching out.

Can you provide me with the complete error message, the translation file and the complete index,js?

Cheers!

Thanks for the prompt reply, Martinkr. Here is the error Server Error Error: Invalid default language 'en'. Check your 'defaultLang' in 'i18n/index.js'?,

  index.js
  var en = require('./translations.en.json');
  var fr = require('./translations.fr.json');
 var hw = require('./translations.hw.json');
 const i18n = {
   translations: {
       en: en.i18n,
       fr: fr.i18n,
       hw: hw.i18n
   },
   defaultLang: "en"
}
module.exports = i18n;
 translations.en.json
{
    "about": {
      "title": "title.",
     }
}

Hey martkinkr, seen the issue already. I added "i18n" as the key to my translation files and it worked. Thanks

Perfect, glad that you could resolve it. If you have any other issues don't hesitate to file a report!

Cheers!