i18n
The simplest I18n plugin for vue.
Installation
npm install biu-i18n --save // Ready translated locale messagesconst message = 'cn-ZH': first: 'first' second: 'second' third: 'third' withParams: '{:param} with' pattern: '{:param}' locale: 'cn-ZH' Vue // OR // Create VueI18n instance with optionsconst i18n = 'cn-ZH': first: 'first' second: 'second' third: 'third' withParams: '{:param} with' pattern: '{:param}' locale: 'cn-ZH' i18n
Usage
this thisthisthis// if first is not in languege package , it'll return undifined.this$i18ndbfirst // setLangs, and if you have bind vue to window.vm it will updates auto.this$i18n// if already has 'cn-ZH' language package, you can use follow instruction:this$i18n // hasLangsthis // return true // clearLangsthis$i18n// ORthis$i18n