score:2

Accepted answer

I found solution in exporting i18n object after inicialization and use that at all other places which I need.

file i18nSetup.js:

i18n
    .use(initReactI18next)
    .init({
        resources: translationResources,
        interpolation: {
            escapeValue: false 
        }
    });

export default i18n;

In other files:

import i18n from "../functions/i18nSetup";

export function translateCell(cell) {
  return (i18n.t(cell));
}

score:0

Try like this:

import { Trans } from 'react-i18next';

and use it like this:

<Trans>word-key</Trans>

https://react.i18next.com/guides/quick-start


Related Query

More Query from same tag