A deadly simple i18n translate plugin for Vue, ready for Server Side Rendering.
Demo
Usage
yarn add vue-translator复制代码
Basic Usage
import Vue from 'vue'
import VueTranslator form 'vue-translator'
Vue.use(VueTranslator, {
locale?: string, // set it on initialize or before first rendering
translations?: { // If you want to define translations in component only, no need to set it on initialize
[locale: string]: {
[key:string]: string | array | object
}
},
defaultLocale?: string, // when no value can be found in current locale, try to fallback to defaultLocale
merge?: Function // `lodash.merge` for example, if you