ngx-azm
v0.0.11
Published
Welcome to ngx-azm , it is the first npm package for me , and I will try to add the most resuable code we need in our real projects .
Downloads
4
Readme
NgxAzm
Welcome to ngx-azm , it is the first npm package for me , and I will try to add the most resuable code we need in our real projects .
It contains:
AzmTranslateBackendPipe
Import
import { AzmTranslateBackendPipe } from 'ngx-azm'
Usage
{{ Object | azmTranslateBackend: selectedLanguage : propertyName :isLanguagePrefix}}
Let's assume we have object like this from backend:
let a = { arGreeting:'مرحبا' , enGreeting:'Hello' , titleEn:'Software Developer' , titleAr:'مطور برامج' };
If we need to get the english translation of greeting, we will use like that:
{{ a | azmTranslateBackend:'en':'greeting':true}}
in this case the language abreviation is prefix , so we send true. But in the other case in title with arabic language we will access like that:
{{ a | azmTranslateBackend:'ar':'title':false}}
Hope you enjoy and feel free to contribute to it.
Thanks