Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Language property is not observable #73

Open
AnReZa opened this issue Jun 17, 2019 · 1 comment
Open

Language property is not observable #73

AnReZa opened this issue Jun 17, 2019 · 1 comment

Comments

@AnReZa
Copy link

AnReZa commented Jun 17, 2019

According to this comment to a ticket, it seems like the language property isn't observable. This leads to some issues with bootstrap-vue. Is there a simple way to fix that issue?

@bodograumann
Copy link

bodograumann commented Aug 8, 2019

For a quick fix, you can use this.$i18n.i18nLoadedAt && this.$i18n.i18next.language).

Explanation

A priory anything on the i18next object is not reactive, because it is completely unrelated to vue. @panter/vue-i18next does add the property $i18n and gives you exactly one reactive element: i18nLoadedAt. Whenever i18next emits an event languageChanged or loaded, that value is updated. Now $t accesses i18nLoadedAt and is thus also reactively updated on those events.

Feature Request

Please also provide a reactive property language on $i18n, that is updated on the languageChanged event. This way anything in the application can use the current locale reactively.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants