title: How to save current language (i18n) in localstorage (Vue)
body: <p>I'm developing an app in Vue using Vue Routers and Vue $i18n plugin.
  <br>This is my HTML:</p>
  <pre><code>&lt;div class=&quot;locale-changer&quot;&gt;
    &lt;select v-model=&quot;this.$i18n.locale&quot; class=&quot;btn&quot;&gt;
      &lt;option v-for=&quot;(lang, i) in langs&quot; :key=&quot;`Lang${i}`&quot; :value=&quot;lang&quot;&gt;{{ lang }}&lt;/option&gt;
    &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  <p>And my JS:</p>
  <pre><code>export default {
    name: &quot;home&quot;,
    data() {
      return {
        langs: ['Español', 'English'],
        currentlang: this.$i18n.locale
      }
    },
    mounted() {
      if(localStorage.currentlang) this.currentlang = localStorage.currentlang;
    },
    watch: {
      currentlang(newLang) {
        localStorage.currentlang = newLang;
      }
    }
  };
  </code></pre>
  <p>I have already searched the Internet but still cannot get it. <br>
  Hope you can help me! Thanks &lt;3</p>