2.0.0-rc.2 • Published 9 years ago
plato-i18n v2.0.0-rc.2
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>License
2.0.0-rc.2
9 years ago
2.0.0-rc.1
9 years ago
2.0.0-beta.3
9 years ago
2.0.0-beta.2
9 years ago
2.0.0-beta.1
9 years ago
0.0.1
9 years ago