Home

Issue: 1856

inject('i18n', new VueI18n(...)) doesn't work in plugin files

[issue link]

But app.i18n = new VueI18n(...) works.
It means the example in https://nuxtjs.org/guide/plugins fails.

It reported: Cannot read property '_t' of undefined in node_modules/vue-i18n/dist/vue-i18n.common.js:L176:

return i18n._t.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this ].concat( values ))

related package info:

    "nuxt": "^1.0.0-rc11",
    "vue-i18n": "^7.3.1",
This question is available on Nuxt.js community (#c1670)