You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My app consists of different layers, the frontend Vue app, a frontend library, a Node.js backend and a utils package used by both the frontend and backend. All of these need to be internationalized, and obviously I want to use the same translation library/technology for each of them.
I wasn't able to find much documentation about how to use vue-i18n outside of Vue components, but from the TypeScript types it seems that I can probably call i18n.global.t() to translate messages. However, as far as I understand, calling createI18n() will require Vue as a dependency. This means that people who want to use my frontend library or my utils package will require Vue as a dependency even if they don't use it in their app at all. This is not ideal.
Is there a recommended way to use vue-i18n outside of Vue components? Can I somehow use the @intlify/* packages directly?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My app consists of different layers, the frontend Vue app, a frontend library, a Node.js backend and a utils package used by both the frontend and backend. All of these need to be internationalized, and obviously I want to use the same translation library/technology for each of them.
I wasn't able to find much documentation about how to use vue-i18n outside of Vue components, but from the TypeScript types it seems that I can probably call
i18n.global.t()
to translate messages. However, as far as I understand, callingcreateI18n()
will require Vue as a dependency. This means that people who want to use my frontend library or my utils package will require Vue as a dependency even if they don't use it in their app at all. This is not ideal.Is there a recommended way to use vue-i18n outside of Vue components? Can I somehow use the
@intlify/*
packages directly?Beta Was this translation helpful? Give feedback.
All reactions