Git Product home page Git Product logo

Comments (12)

 avatar commented on May 28, 2024

@Romanchuk can you please give you insights ? :)

from angular-i18next.

Romanchuk avatar Romanchuk commented on May 28, 2024

@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:
#35

from angular-i18next.

 avatar commented on May 28, 2024

I see.. thanks for pointing this out.. any work around for now untill you make the changes ?
I really needed this

from angular-i18next.

Romanchuk avatar Romanchuk commented on May 28, 2024

@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

from angular-i18next.

Romanchuk avatar Romanchuk commented on May 28, 2024

Just reload page

from angular-i18next.

 avatar commented on May 28, 2024

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 :)

from angular-i18next.

Romanchuk avatar Romanchuk commented on May 28, 2024

@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.

from angular-i18next.

 avatar commented on May 28, 2024

OKay buddy let me have a look ...

from angular-i18next.

 avatar commented on May 28, 2024

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) => {});
 }

from angular-i18next.

Romanchuk avatar Romanchuk commented on May 28, 2024

@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:
#35 (comment)

from angular-i18next.

Romanchuk avatar Romanchuk commented on May 28, 2024

@koza-tavisca Hello! Any news?

from angular-i18next.

Romanchuk avatar Romanchuk commented on May 28, 2024

Closed because of inactivity.
Related issue was resolved #35

from angular-i18next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.