title: How to get global variable in store mutation
body: <p>I am getting error about using vue-i18n dependance.</p>
  
  <p>How should i get the <strong><em>const i18n</em></strong> from main.js to root.js (store)</p>
  
  <p>I am using</p>
  
  <ul>
  <li>Vuejs 2.X</li>
  <li>Vue-i18n latest</li>
  <li>Vuex For Vuejs 2.X</li>
  </ul>
  
  <p>In main.js (vue-cli)</p>
  
  <pre><code>Vue.use(VueI18n)
  
  const i18n = new VueI18n({
      locale: 'en',
      messages: {
          en: {
              message: en
          },
          cn: {
              message: cn
          }
      }
  })
  
  new Vue({
      store,
      el: '#app',
      i18n,
      router,
      template: '&lt;App/&gt;',
      components: { App }
  })
  </code></pre>
  
  <p>In root.js (store)</p>
  
  <pre><code>export const mutations = {
      [types.SET_LANGUAGE] (state, data) {
          console.log(i18n.locale) // 'i18n' is not defined
          localStorage.setItem('language', data)
      },
  }
  </code></pre>