Search code examples
javascriptreactjsi18nextreact-i18next

How to translate properties with i18next


How I normally use i18next to translate stuff

<Translation>{(t) => <span>{t('key')}</span>}</Translation>

But I'm not too sure how to translate properties such as title value "Dashboard" in the following line

 <NavExpandable title="Dashboard" isExpanded>

I haven't been able to find a solution yet and I can't believe I'm the only one who has this problem.


Solution

  • My problem was that I was using import { Translation } from 'i18next'; instead of import { Translation } from 'react-i18next';