Giter Club home page Giter Club logo

Comments (4)

tinesoft avatar tinesoft commented on June 2, 2024

Hi @magoss ,

This would be indeed a great feature. I will start working on it asap.
Quick question: what translation library do you use? ngx-translate?

from ngx-cookieconsent.

magoss avatar magoss commented on June 2, 2024

Yup, ngx-translate.

from ngx-cookieconsent.

yduartep avatar yduartep commented on June 2, 2024

This could be a great feature. I have to do something like this to allow translations before to open it...

combineLatest(
    this.translate.get('cookie.content'),
    this.translate.get('cookie.button'),
    this.translate.get('cookie.link')
  ).subscribe(data => {
    this.cookieConfig.content.message = data[0];
    this.cookieConfig.content.dismiss = data[1];
    this.cookieConfig.content.deny = data[2];

    this.ccService.init(this.cookieConfig);
    this.ccService.open();
  });

from ngx-cookieconsent.

tinesoft avatar tinesoft commented on June 2, 2024

Hi guys,

So i finally got time to work on this issue. After deep analysis, i came to the conclusion that there will be no direct support of translation inside the library, not with ngx-translate, nor with any other i18n libraries. Instead, i have updated demo app to showcase how this can be performed (inspired from @yduartep's answer, which is the proper way to do it).

The documentation has been updated as well.

Happy coding

from ngx-cookieconsent.

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.