Upgrade of modules and webpack.
Support for localization in progress.
This commit is contained in:
parent
d8b56fff0d
commit
4862d6cac4
52 changed files with 5870 additions and 23064 deletions
|
@ -8,7 +8,7 @@ const interoperableErrors = require('../shared/interoperable-errors');
|
|||
const shares = require('./shares');
|
||||
const namespaceHelpers = require('../lib/namespace-helpers');
|
||||
const bluebird = require('bluebird');
|
||||
const fsReadFile = bluebird.promisify(require('fs').readFile);
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
const mjml = require('mjml');
|
||||
const _ = require('../lib/translate')._;
|
||||
|
@ -184,13 +184,13 @@ async function remove(context, id) {
|
|||
}
|
||||
|
||||
|
||||
// FIXME - add the ability of having multiple language variant of the same custom form
|
||||
async function getDefaultCustomFormValues() {
|
||||
const basePath = path.join(__dirname, '..');
|
||||
|
||||
async function getContents(fileName) {
|
||||
try {
|
||||
const template = await fsReadFile(path.join(basePath, fileName), 'utf8');
|
||||
return template.replace(/\{\{#translate\}\}(.*?)\{\{\/translate\}\}/g, (m, s) => _(s));
|
||||
const template = await fs.readFile(path.join(basePath, fileName), 'utf8');
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ const tools = require('../lib/tools');
|
|||
const crypto = require('crypto');
|
||||
const settings = require('./settings');
|
||||
const {getTrustedUrl} = require('../lib/urls');
|
||||
const _ = require('../lib/translate')._;
|
||||
const { tUI } = require('../lib/translate');
|
||||
|
||||
const bluebird = require('bluebird');
|
||||
|
||||
|
@ -286,7 +286,7 @@ async function resetAccessToken(userId) {
|
|||
return token;
|
||||
}
|
||||
|
||||
async function sendPasswordReset(usernameOrEmail) {
|
||||
async function sendPasswordReset(language, usernameOrEmail) {
|
||||
enforce(passport.isAuthMethodLocal, 'Local user management is required');
|
||||
|
||||
await knex.transaction(async tx => {
|
||||
|
@ -310,7 +310,7 @@ async function sendPasswordReset(usernameOrEmail) {
|
|||
to: {
|
||||
address: user.email
|
||||
},
|
||||
subject: _('Mailer password change request')
|
||||
subject: tUI(language, 'account.passwordChangeRequest')
|
||||
}, {
|
||||
html: 'emails/password-reset-html.hbs',
|
||||
text: 'emails/password-reset-text.hbs',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue