G
G
grabbee2021-04-09 12:24:09
Internationalization and localization
grabbee, 2021-04-09 12:24:09

How to use vue i18n in js module?

I want to move the logic of composing some phrase from the data into a separate module, so that later I can connect it in the component. And the translator is available only in the component. Whereas the parts of the phrase are in the module. How do I access vue-i18n functions in a js module?
*$t('name')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grabbee, 2021-04-09
@grabbee

https://github.com/kazupon/vue-i18n/issues/149#iss...
You need to create an instance of i18n in a separate module and import it wherever you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question