Closed ghost closed 4 years ago
@Romanchuk can you please give you insights ? :)
@koza-tavisca my guess: it happends because of i18nextPipe is pure pipe. Language changed but for pipe input key stayed the same, so it won't trigger recalc of the pipe. Simpliest option to solve it - is to reload page.
Also i want to return to idea to implement alternative impure i18next pipe
Here you can see story and reasons behind why pipe is pure: https://github.com/Romanchuk/angular-i18next/issues/35
I see.. thanks for pointing this out.. any work around for now untill you make the changes ? I really needed this
@koza-tavisca Here is an implementation in the demo app: https://github.com/Romanchuk/angular-i18next-demo/blob/13180dacea142959ff892c727f54701d6f483f99/src/app/structure/header-controls/header.language.component.ts
Just reload page
Yeah got one work around but reloading page is not the best practice for mobile app.so let me know if you have any more dynamic solution I have tried my all ways.. out of ideas now..
Thanks :)
@koza-tavisca Hi, i just released version 7.2.0-beta with a new i18nextEager pipe. It is impure pipe so i highly recommend to use it only in combine with OnPush change detection strategy, or else (default change detection) each pipe will retrigger more than one time. You can use it without reloading page. Also this release supports latest i18next version.
OKay buddy let me have a look ...
I have installed the version that you have specified and do following changes on html.
<p> {{ '_profile.label.do_you_provide_any_services' | i18nextEager }}</p>
Still when I change language using following function its now reflecting directly. I need to go back to previous page and need to come back again for changes.
selectLanguage(event) {
i18next.changeLanguage(event.target.value, (err, t) => {});
}
@koza-tavisca Its hard to tell. Why don't you change language throught I18nextService that is intergated with angular? You dont need to directly call methods of 18next. Here is example in demo: https://github.com/Romanchuk/angular-i18next-demo/blob/master/src/app/structure/header-controls/header.language.component.ts
i18nextEager pipe works for me and person in related issue: https://github.com/Romanchuk/angular-i18next/issues/35#issuecomment-579183309
@koza-tavisca Hello! Any news?
Closed because of inactivity. Related issue was resolved #35
Hi here is what I do..
my app module
IN my profile page I change language using i18next service my this...
but when my drop down select the value language is not changing.. when I come back to profile page its changes.. but on home page its same .. so what's the problem is ??
I have used lazy load and in each module I have added I18NextModule.forRoot(), in providers.
please help :)