vue-translater
Description
vuejs package helps you intergate translation with vuejs apps.
Getting Started
npm i vue-translater
Usage
Use vue-translater
with your vue
instance :
;; let options = name: 'storageItemName' translate: en: 'hello': 'hello' 'developer': 'developer' fr: 'hello': 'bonjour' 'developer': 'développeur' es: 'hello': 'hola' 'developer': 'desarrollador' ; Vue;
Direct access from vue instance
this$trans
Or by v-trans
directive.
you can set your json
object that contain all key: value
translation :
this$trans
transObject
may be like :
langIsoCode1: keyword: "ValueLang1" langIsoCode2: keyword: "ValueLang2"
Inside you vue component :
<!-- Or -->
For html tags attributes you can do it like :
<!-- this use case takes an array with two elements, the first one take the string and the second take the arguments --><!-- for multiple slots in the same string you should set the values in second array in order with `:attr` in your string--><!-- and the sample use case is like -->
For multiple attributes in the same html tag you can do it like :
these example will be converted to ( displayed value is based on active language )
<label>ValueLang1</label>
inside vue instance :
this$trans
languages
To active a specific language :
this$trans
To get the active language :
this$trans
To get all registred languages :
this$trans // this will return all isoCode Languages set on translateObject