meteor-vue / vue-meteor

🌠 Vue first-class integration in Meteor
896 stars 111 forks source link

vue-i18n compatibility with Vue 2.x #241

Open ipa1981 opened 7 years ago

ipa1981 commented 7 years ago

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?

alexandesigner commented 7 years ago

Have you tried using another lib?

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

ipa1981 commented 7 years ago

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')