v-t directive does not rerender when locale switches #1994
Labels
has the workaround
legacy
🔨 p3-minor-bug
Priority 3: a bug in an edge case that only affects very specific usage
Reporting a bug?
v-t
directive does not update when locale switchesExpected behavior
Changing the locale updates all references of
v-t
Reproduction
Stackblitz: https://stackblitz.com/edit/vitejs-vite-3sfn11?file=src%2FApp.vue
GitHub Repo: https://github.com/DerZade/vue-i18n-locale-switching-bug-report
System Info
Screenshot
No response
Additional context
I started investigating this and found that apparently the composer of the
v-t
in my example is not the global composer (I don't know why tho, since there is only one instance in the whole app), therefore the watcher for the locale isn't added in the register hook of the directive:vue-i18n/packages/vue-i18n-core/src/directive.ts
Lines 102 to 107 in 43072e8
Really dumb question: Why can't we just always add the watcher, why does it only work for the global instance?
Validations
The text was updated successfully, but these errors were encountered: