angular-tiny-translate
v1.1.1
Published
small library to translate with current language without any implicit loading and other unused trash. you load only library and attach into your app translations and that is it.
Downloads
5
Maintainers
Readme
angular-tiny-translate
install
npm install angular-tiny-translate -S
Small modular library for translations without unused dust
angular
.module('my.app', [
'angular-tiny-translate'
])
/*@ngInject*/
.config((TinyTranslate) => {
TinyTranslate.translates({
'some_prefix1': {
'some_key1': 'some_translation1'
},
'some_prefix2': {
'some_key2': 'some_translation2',
'*': '{*} times'
}
})
})
<!-- someVar = 'some_key2' -->
<h1>{{ someVar | tr: 'some_prefix2' }}</h1>
<!-- result -->
<h1>some_translation2</h1>
<!-- someVar = '5' -->
<h1>{{ someVar | tr: 'some_prefix2' }}</h1>
<!-- result -->
<h1>5 times</h1>