I am currently using i18next to translate my interface.
const { t, i18n } = useTranslation();
function handleClick(lang) {
i18n.changeLanguage(lang);
}
This code is applied to two buttons.
<a onClick={ () => handleClick('en') }
className="language-selector__link">EN</a>
<a onClick={ () => handleClick('de') }
className="language-selector__link">DE</a>
I am trying to figure out how to change the weight or make the selected language bold. I have attempted something like this but it's not working correctly:
style={ handleClick ? { fontWeight:'800'} : {fontWeight : '400'} }
Any suggestions would be appreciated. Thank you!