How to use ngneat-transloco with primeng?

UI Components for Angular
Post Reply
superholz
Posts: 3
Joined: 30 Dec 2020, 17:48

09 Jan 2021, 00:36

Hi, I'm trying ngneat-transloco library to internationalize my angular app (as alternative to using ngx-translate). I get it to work but struggling to get primeng-components translated (such as a calender e.g.).

For ngx-translate i understand that the approach is to use PrimeNGConfig like this:

Code: Select all

    this.translateService.get('primeng').subscribe(res => this.primengconfig.setTranslation(res));
But how to achieve the same with transloco? I would appreciate any hints.

Transloco documentation: https://ngneat.github.io/transloco/docs/translation-api

superholz
Posts: 3
Joined: 30 Dec 2020, 17:48

09 Jan 2021, 01:28

Seems to be that I found part of the solution myself:
in constructor

Code: Select all

public translateService: TranslocoService,
in method

Code: Select all

this.primengconfig.setTranslation(this.translateService.translateObject('primeng'));

That seams to work.... half. Months are translated, names of days of a calendar are still not translated. Any hints on this?

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: signorcase and 7 guests