Vue-i18n: Using vue-i18n with Node without Vue?

Created on 25 Apr 2019  路  6Comments  路  Source: kazupon/vue-i18n

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!

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.

All 6 comments

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

  • Centralize i18n messages For back ends and front ends :tokyo_tower:
  • Front with vue :globe_with_meridians:
  • Backedn with nodejs for example sending email or Generate PDF or etc ... :email:

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.

Was this page helpful?
0 / 5 - 0 ratings