środa, 7 lutego 2018

How to add translated string to JHipster Angular5 .ts file

Let’s assume we have already language files in /src/main/webapp/i18n/


In .component.ts file import:


 import { TranslateService } from '@ngx-translate/core';

Add to constructor:


1
       private translateService: TranslateService,


Then translated string is:


const translatedString=this.translateService.instant("global.menu.entities.substitute");




Brak komentarzy:

Prześlij komentarz