Vue-i18n: Dynamic local changing no longer works in v6

Created on 19 Apr 2017  路  4Comments  路  Source: kazupon/vue-i18n

In v4 we used to dynamically change the language by changing Vue.config.lang object. This no longer seem to work. Bug or breaking change?

Is there a new way (API) to click on a link to dynamically change the locale whenever the Vue.config.lang changes ?

Most helpful comment

Well..IMO: It's still a serious bug if the user base needs many hours to correct this, deprecation or not. We are in production after all.

In addition, the documentation hardly explains how to re-enable the Vue.config.lang reactivity that is spread out over our code...

So well.. closed, but not solved ;)

All 4 comments

Note, I now use

  this.$i18n.locale = Vue.config.lang

But it's not particular pretty as it is not reactive...

Vue.config.lang is deprecated in v6 or later.
See the docs:
https://kazupon.github.io/vue-i18n/en/migrations.html#lang-replaced

Well..IMO: It's still a serious bug if the user base needs many hours to correct this, deprecation or not. We are in production after all.

In addition, the documentation hardly explains how to re-enable the Vue.config.lang reactivity that is spread out over our code...

So well.. closed, but not solved ;)

You can clearly see how to change the locale in the docs referenced by kazupon, and you still got the reactivity too. So if you come from a search engine, just follow that link.

Was this page helpful?
0 / 5 - 0 ratings