martinkr/next-export-i18n

Manually changing the lang query param causes no translations

cyntler opened this issue · 2 comments

If we have the config like that:

const en = require('./translations.en.json');
const pl = require('./translations.pl.json');

const translations = {
  en,
  pl,
};

const defaultLang = Object.keys(translations)[0];

module.exports = {
  translations,
  defaultLang,
};

and then when we add a query param lang with a value of i.e. test (?lang=test) then we get a problem with the translation. It means that useTranslation returns the key instead of translation of default lang.

Ok, I have a fix.

Thank you for catching this issue!