You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi
trying to add vuex-i18n to my nuxt project no luck so far .
i'm getting this error message,
Cannot set property $i18n of [object Object] which has only a getter
my code so far :
import Vue from 'vue'
import Vuex from 'vuex'
// load and register the vuex i18n module
import vuexI18n from 'vuex-i18n/dist/vuex-i18n.umd.js'
const doDebug = process.env.NODE_ENV !== 'production'
const store = new Vuex.Store({
strict: doDebug
})
Vue.use(
vuexI18n.plugin,
store,
{
onTranslationNotFound: function (locale, key) {
console.warn(`vuex-i18n :: Key '${key}' not found for locale '${locale}'`)
}
})
import { english } from '~/static/i18n/en.json'
import { farsi } from '~/static/i18n/fa.json'
Vue.i18n.add('en', english);
Vue.i18n.add('fa', farsi);
Vue.i18n.set('fa')
Vue.i18n.fallback('fa')
export default store
The text was updated successfully, but these errors were encountered:
Thank you for reporting this issue. The plugin is adding the property $i18n to the Vue prototype, to make the translations accessible in all components. It seems to me, that your issue might be related to one of the following:
hi
trying to add vuex-i18n to my nuxt project no luck so far .
i'm getting this error message,
my code so far :
The text was updated successfully, but these errors were encountered: