Page 1 of 1

How to use ngneat-transloco with primeng?

Posted: 09 Jan 2021, 00:36
by superholz
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

Re: How to use ngneat-transloco with primeng?

Posted: 09 Jan 2021, 01:28
by superholz
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?

Re: How to use ngneat-transloco with primeng?

Posted: 13 May 2021, 14:52
by tleveque
Curious to know, have you found a solution since then?

Re: How to use ngneat-transloco with primeng?

Posted: 13 Dec 2021, 13:34
by sergio.bellini
news about transloco?