I'm using react-i18next in a React app.
As in the Quick Start guide, I can easily get the current language in a function component, with the useTranslation
hook:
import { useTranslation } from 'react-i18next';
...
const { t, i18n } = useTranslation();
const language = i18n.language;
But how to get it in a utility function, where I can't use the hook?