angular - How to get translation by key in component Angular2? -
i use library angualar 2 translations:
https://github.com/ngx-translate/core
in json file have worb key:
{ "delete_selected" : "Удалить выделенные", }
then inside component try fill object as:
let obj = { title: <delete_selected> };
how translation key word?
i've never used library, i'm 90% sure trick :
translate.get('delete_selected').subscribe((res: string) => { console.log(res); //=> '"Удалить выделенные"' });
Comments
Post a Comment