Using internationalization in modules outside Kraken.
npm install express-generator -g
to install express-generator (if not already done)express
inside the directorynpm install
to install dependenciesnpm uninstall --save jade
: making room for dustnpm install --save adaro
to install the dust engine- Creating basic .dust templates in
views/
and removing jade templates - Modifying
app.js
with adaro (see CHANGE comments)
npm install --save makara
npm install --save dust-makara-helpers
npm install --save express-bcp47
to add a middleware that sets req.locale (see makara tutorial)- Creating
locales/
with subfolders containing .properties - Modifying
app.js
with makara and bcp47 (see CHANGE2 comments)
npm install --save nodemailer
- Modifying
app.js
's routes (see CHANGE3 comments) - Creating email templates
views/email/html.dust
andviews/email/plaintext.dust
and corresponding locales - Modifying
route/email.js
for nodemailer integration, see this list of supported services and modify the file with your own email credentials.
How to render the template outside of a request?