Home

Issue: 502

Integration of vue-i18n

[issue link]

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!

This question is available on Nuxt.js community (#c439)