Giter Site home page Giter Site logo

Comments (4)

shaharkazaz avatar shaharkazaz commented on June 2, 2024

@GitHubish I can't fully understand your scenario and there are no instructions for your reproduction (seems like it's just the playground app).
Please provide a reproduction for your case. generally speaking, if you want to control the language of a specific component you can do that by using the static flag, e.g. lang: '{previewLang}|static'.

from transloco.

GitHubish avatar GitHubish commented on June 2, 2024

Sorry @shaharkazaz for not providing enough in my explanation. What I'm trying to do is display a component in a selected language (so the change is dynamic) and this language may therefore be different from the "global" language of my application. The use case is that of a preview of a page that will be printable, this page is made up of a set of components (graphics) and must therefore be displayed in the language selected in a drop-down list without changing the language of the rest of the application. I use an @input to pass them the selected language and I wanted the translations to change using one of the methods on the "Multiple Languages Simultaneously" page, but this doesn't work. I can't use the static argument as it's dynamic.

I hope this has made things clearer?

new example : https://codesandbox.io/p/sandbox/ngneat-transloco-forked-564v38?file=%2Fsrc%2Fapp%2Fmulti-langs%2Fmulti-langs.component.html%3A1%2C1

Thank you

from transloco.

shaharkazaz avatar shaharkazaz commented on June 2, 2024

@GitHubish Thanks, it's clear.
I'll think about how I want to approach this, but generally speaking, the directive isn't listening to input changes and that's the issue here

from transloco.

GitHubish avatar GitHubish commented on June 2, 2024

@shaharkazaz Thank you very much! Also with the pipe, I guess it's the same thing, it doesn't listen to the change and therefore doesn't update the key translation

from transloco.

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.