vue-i18n
vue-i18n copied to clipboard
Allow calling i18n.global.setLocaleMessage() in <script setup>
trafficstars
Clear and concise description of the problem
Allow calling i18n.global.setLocaleMessage() in
Suggested solution
Do app.provide() an i18n instance with a 'user-known' name or symbol, so that the user code can access the i18n instance with inject().
BTW, we can access an i18n instance by setting it to a global variable. But for SSR(Server-Side-Rendering), we should avoid global variables.
Or, we can access an i18n instance by making our own plugin that app.provide()s the i18n instance into Vue app, but it would be convenient if vue-18n provides that functionality.
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.