vue-i18n icon indicating copy to clipboard operation
vue-i18n copied to clipboard

Allow calling i18n.global.setLocaleMessage() in <script setup>

Open zeodtr opened this issue 3 years ago • 0 comments
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

zeodtr avatar May 12 '22 02:05 zeodtr