vue-i18n
vue-i18n copied to clipboard
vue-i18n-bridge breaks in multiple Vue instances
Reporting a bug?
We have been utilizing multiple Vue root instances created with new Vue({}) on the same page successfully. However, when upgrading to Vue 2.7 and implementing the vue-i18n-bridge, we encountered an issue. The problem arises when we are required to use Vue.use(i18n);, which disrupts the functionality of all instances except for the last one.
Expected behavior
The vue-i18n-bridge is capable of working with multiple Vue root instances. For each instance, it allows us to set distinct numberFormats and datetimeFormats independently.
Reproduction
https://codesandbox.io/p/sandbox/happy-hugle-m2963z?file=%2Fsrc%2FLocaleSwitch.vue%3A19%2C12
When switching the language on the first app, the translation appears to be broken. However, when switching it on the last app, the translation works as expected.
System Info
System:
OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
CPU: (2) x64 AMD EPYC
Memory: 514.36 MB / 2.01 GB
Container: Yes
Shell: 5.8 - /bin/zsh
Binaries:
Node: 18.15.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.5.0 - /usr/local/bin/npm
npmPackages:
@vitejs/plugin-vue2: ^2.2.0 => 2.2.0
vite: ^4.1.0 => 4.1.1
vue: ^2.7.0 => 2.7.14
vue-i18n: ^8.28.2 => 8.28.2
vue-i18n-bridge: ^9.2.2 => 9.2.2
vue-tsc: ^1.0.24 => 1.0.24
Screenshot
Additional context
This issue is the final hurdle in our ongoing Vue 2.7 upgrade, and if a resolution cannot be found, we would sincerely appreciate any available workarounds. However, we kindly request that upgrading to Vue 3 is not considered as a solution. Thank you!
Validations
- [X] Read the Contributing Guidelines
- [X] Read the Documentation
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussions