libj-vue-i18n
v2.0.0
Published
Adds support for localizing vue components and instances (using vue-i18n)
Downloads
6
Readme
libj-vue-i18n
Part of libj tools
Adds support for localizing vue components and instances (using vue-i18n)
Needs Vue and libj-culture-manager globally
Usage
npm i libj-vue-i18n
import 'libj-vue-i18n';
// Now, Vue.localize is available
new Vue ({
el: '#app',
i18n: Vue.localize(messages: {
en: {
key: "value"
},
fa: {
key: "value2"
},
.
.
.
}),
mounted() {
this.$t('key') // => "value" or "value2" based on cultureManager.getActiveCulture().code
}
})