Closed faculezcano closed 2 years ago
@faculezcano Ok, i'll check it in demo app
I've make it work! I was trying to trigger the language change from a custom implementation of LocalStorage setItem (i know nasty shit, it was a PoC) something like:
const originalSetItem = localStorage.setItem;
localStorage.setItem = (key: string, value: string) => {
if(key === 'lang') {
i18nService.changeLanguage(value);
}
originalSetItem(key, value);
};
The strange thing is that above code trigger the logs of i18next saying that the language was changed, but the texts didn't get rerendered. Finally i've used a CustomEvent to trigger the language change and the texts get rerendered perfectly.
@faculezcano
i18next saying that the language was changed,
It was changed, but zone.js needs event to trigger cd. So you did it correct
I have a lazy loading module in a rounting with a component that uses i18nextEager pipe, i trigger a lang change but the text isnt updating.