plato-i18n
v2.0.0-rc.2
Published
:globe_with_meridians: A Simple I18n Plugin for Vue
Downloads
4
Readme
PLATO-I18N
:globe_with_meridians: A Simple I18n Plugin for Vue
Usage
install plugin
import Vue from 'vue'
import I18n from 'plato-i18n'
Vue.use(I18n, {
// set global resources
data () {
// return json
// could use vuex.store for reactive
return {
a: {
b: 'c{d}e'
}
}
}
})
set resources in components
export default {
name: 'App',
// optional
i18n: {
// set local resources
// would OVERRIDE global resources
data () {
return {
a: {
b: 'c[0]e'
}
}
}
}
}
use resources in components
<template>
{{__('a.b', { d: 'D' })}}
<!-- or -->
{{__('a.b', ['D'])}}
</template>