Static GitHub Issues

[502] Integration of vue-i18n

prev: Middleware for a specific page not working.
next: save state on server side

Hey guys, I'm just porting our VueJS project to NuxtJS. So far everything worked.

But now I have to include this plugin: https://github.com/kazupon/vue-i18n

The problem is, we have to do something like this in order to make it work:

import i18n from './i18n'

const app = new Vue({
  router,
  store,
  i18n,
  ...App
})

The i18n.js file looks like this:

import Vue from 'vue'
import VueI18n from 'vue-i18n'

Vue.use(VueI18n)

export default new VueI18n({
  locale: 'de',
  fallbackLocale: 'en'
})

I already added it to the "plugins" section inside the nuxt.config.js:

  plugins: [
    '~plugins/vuetify.js',
    '~plugins/i18n.js'
  ],

But it says "this.$t" is undefined. I think we need to add it into the "new Vue(...)" part.

Is it possible to get this plugin into this part?

Thank you so much for this great work!

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c439">#c439</a>)</em></sub></div>