vue-i18n
vue-i18n copied to clipboard
Is there any way to make injected properties local scope in Composition mode
Clear and concise description of the problem
For some reason, I have to use both Vue composition API and Vue legacy API in my project.
I prefer composition API, so I set legacy: false and globalInjection: true, i18n will be in Composition mode and I can use $i18n in code.
But $i18n.locale always refers to global scope locale, and I can't use local scope in Vue legacy code.
Suggested solution
Add some config to change injected properties's scope, when the Vue component have locale scope, injected properties can refers to local scope
Alternative
No response
Additional context
No response
Validations
- [X] Read the Contributing Guidelines
- [X] Read the Documentation
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Or maybe export some API that can access local i18n composer from Legacy Vue code
Additionally, $i18n refers to local scope when there is i18n option in Legacy mode.