microapps/gatsby-plugin-react-i18next

missingKeyHandler and parseMissingKeyHandler not working

LucasBassetti opened this issue · 2 comments

Hi, I'm trying to use the missingKeyHandler and parseMissingKeyHandler but it's not working. When I try to do some like that:

{
  resolve: `gatsby-plugin-react-i18next`,
  options: {  
    ...
    i18nextOptions: {
      debug: true, // if true, you can see errors in console
      saveMissing: true,
      missingKeyHandler: function () {
        console.log("missingKeyHandler");
      },
      parseMissingKeyHandler: function () {
        console.log("parseMissingKeyHandler");
      },
      ...
    }
  }
}

I'm getting this from debug

saveMissing: true,
missingKeyHandler: false,
parseMissingKeyHandler: false,

Does anyone know how to use them?

Experiencing this same issue, wondering if anyone has found a fix yet?

@LucasBassetti The useTranslation hook exposes the i18n instance along with the t() function. I've worked around this issue by calling i18n.on('missingKey') inside my root components where needed. Hope that helps.