translation.js -> translations.js
kept confusing my why i can't find this file! this is in line with the rest of our code
This commit is contained in:
@@ -26,7 +26,7 @@ const assert = require('assert'),
|
||||
nodemailer = require('nodemailer'),
|
||||
path = require('path'),
|
||||
safe = require('safetydance'),
|
||||
translation = require('./translation.js'),
|
||||
translations = require('./translations.js'),
|
||||
util = require('util');
|
||||
|
||||
const MAIL_TEMPLATES_DIR = path.join(__dirname, 'mail_templates');
|
||||
@@ -80,7 +80,7 @@ function render(templateFile, params, translationAssets) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (typeof translationAssets === 'object') raw = translation.translate(raw, translationAssets);
|
||||
if (typeof translationAssets === 'object') raw = translations.translate(raw, translationAssets);
|
||||
|
||||
try {
|
||||
content = ejs.render(raw, params);
|
||||
@@ -98,7 +98,7 @@ async function sendInvite(user, invitor, email, inviteLink) {
|
||||
assert.strictEqual(typeof inviteLink, 'string');
|
||||
|
||||
const mailConfig = await getMailConfig();
|
||||
const translationAssets = await translation.getTranslations();
|
||||
const translationAssets = await translations.getTranslations();
|
||||
const { fqdn:dashboardFqdn } = await dashboard.getLocation();
|
||||
|
||||
const templateData = {
|
||||
@@ -113,7 +113,7 @@ async function sendInvite(user, invitor, email, inviteLink) {
|
||||
const mailOptions = {
|
||||
from: mailConfig.notificationFrom,
|
||||
to: email,
|
||||
subject: ejs.render(translation.translate('{{ welcomeEmail.subject }}', translationAssets), { cloudron: mailConfig.cloudronName }),
|
||||
subject: ejs.render(translations.translate('{{ welcomeEmail.subject }}', translationAssets), { cloudron: mailConfig.cloudronName }),
|
||||
text: render('welcome_user-text.ejs', templateData, translationAssets),
|
||||
html: render('welcome_user-html.ejs', templateData, translationAssets)
|
||||
};
|
||||
@@ -133,7 +133,7 @@ async function sendNewLoginLocation(user, loginLocation) {
|
||||
assert.strictEqual(typeof city, 'string');
|
||||
|
||||
const mailConfig = await getMailConfig();
|
||||
const translationAssets = await translation.getTranslations();
|
||||
const translationAssets = await translations.getTranslations();
|
||||
const { fqdn:dashboardFqdn } = await dashboard.getLocation();
|
||||
|
||||
const templateData = {
|
||||
@@ -149,7 +149,7 @@ async function sendNewLoginLocation(user, loginLocation) {
|
||||
const mailOptions = {
|
||||
from: mailConfig.notificationFrom,
|
||||
to: user.email,
|
||||
subject: ejs.render(translation.translate('{{ newLoginEmail.subject }}', translationAssets), { cloudron: mailConfig.cloudronName }),
|
||||
subject: ejs.render(translations.translate('{{ newLoginEmail.subject }}', translationAssets), { cloudron: mailConfig.cloudronName }),
|
||||
text: render('new_login_location-text.ejs', templateData, translationAssets),
|
||||
html: render('new_login_location-html.ejs', templateData, translationAssets)
|
||||
};
|
||||
@@ -163,7 +163,7 @@ async function passwordReset(user, email, resetLink) {
|
||||
assert.strictEqual(typeof resetLink, 'string');
|
||||
|
||||
const mailConfig = await getMailConfig();
|
||||
const translationAssets = await translation.getTranslations();
|
||||
const translationAssets = await translations.getTranslations();
|
||||
const { fqdn:dashboardFqdn } = await dashboard.getLocation();
|
||||
|
||||
const templateData = {
|
||||
@@ -176,7 +176,7 @@ async function passwordReset(user, email, resetLink) {
|
||||
const mailOptions = {
|
||||
from: mailConfig.notificationFrom,
|
||||
to: email,
|
||||
subject: ejs.render(translation.translate('{{ passwordResetEmail.subject }}', translationAssets), { cloudron: mailConfig.cloudronName }),
|
||||
subject: ejs.render(translations.translate('{{ passwordResetEmail.subject }}', translationAssets), { cloudron: mailConfig.cloudronName }),
|
||||
text: render('password_reset-text.ejs', templateData, translationAssets),
|
||||
html: render('password_reset-html.ejs', templateData, translationAssets)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user