forwardemail / email-templates

Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
https://forwardemail.net/docs/send-emails-with-node-js-javascript
MIT License
3.64k stars 339 forks source link

[fix] i18n - auto translate #445

Closed Zetanova closed 1 year ago

Zetanova commented 1 year ago

In the readme is mention lad/i18n is included and ladjs/mandarin is used to auto-translate locale files. I set the GOOGLE_APPLICATION_CREDENTIALS

The issue is that all locales files get created as a copy based of en.json without google translation ladjs/mandarin itself is not a dependency of email-templates

How is auto-translate supposed to work with email-templates
is something with the documentation missing or obsolate?

titanism commented 1 year ago

Yes, @ladjs/i18n will cause the locales to be generated. But you need to also run Mandarin locally to translate those generated files. See the example at https://github.com/forwardemail/forwardemail.net/blob/master/jobs/translate-phrases.js.