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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -