Hi there,
I'm trying to use vue-i18n server-side to translate some email templates with a process as close as possible of what we're doing client-side.
I got it working like this: https://runkit.com/nicooprat/vue-i18n-node. It could be fine this way but it's sad to import Vue only to init vue-i18n...
Would it be possible to get it working without Vue and Vue.use()?
Thanks!
Unfortunatly, vue-i18n need to require vue.
In the future, I extract i18n common features and I have plan to provide that as the library/framework.
Glad to hear! For what's it's worth, it's possible to use it with Vue server-side as is. If needed to render some components, just use vue-server-renderer: https://ssr.vuejs.org/guide/#rendering-a-vue-instance
Is there any method to use locales file without VueJS
I think will be great if translate library seperate with vuejs dependency.
As long as the i18n library you use in your backend can understand the format of the translation files, there's no problem at all I guess!
I think this must be part of documentation, using plurals, formatted or etc just using this package and messages.
Contribution welcome.
Most helpful comment
Unfortunatly, vue-i18n need to require vue.
In the future, I extract i18n common features and I have plan to provide that as the library/framework.