vue-meteor icon indicating copy to clipboard operation
vue-meteor copied to clipboard

vue-i18n compatibility with Vue 2.x

Open ipa1981 opened this issue 8 years ago • 2 comments

Hello, In vue-i18n docs it is mentioned it's compatible with 1.x only. I use Vue 2 in my project which works well. But installing vue-i18n drags vue 1.0.6 dependency.

Any plans/updates with Vue 2 support?

ipa1981 avatar Aug 14 '17 17:08 ipa1981

Have you tried using another lib?

For example: https://github.com/kazupon/vue-i18n or https://github.com/dkfbasel/vuex-i18n

alexandesigner avatar Aug 17 '17 11:08 alexandesigner

I've tried, but have no idea how to initialize it with vue-meteor, as everything happens under the hood.

For example how to import run Vue.use(VueI18n) and later new Vue({ i18n }).$mount('#app') if I use {{> VueComponent ... }}?

From docs of vue-i18n:

// If using a module system (e.g. via vue-cli), import Vue and VueI18n and then call Vue.use(VueI18n).
// import Vue from 'vue'
// import VueI18n from 'vue-i18n'
//
// Vue.use(VueI18n)

// Ready translated locale messages
// .....

// Create VueI18n instance with options
const i18n = new VueI18n({
  locale: 'ja', // set locale
  messages, // set locale messages
})


// Create a Vue instanc with `i18n` option
new Vue({ i18n }).$mount('#app')

ipa1981 avatar Aug 17 '17 12:08 ipa1981