Manually changing the lang query param causes no translations
cyntler opened this issue · 2 comments
cyntler commented
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.
cyntler commented
Ok, I have a fix.
martinkr commented
Thank you for catching this issue!