mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-04 17:04:59 +03:00
Replace i18n with tpl in api/v2/utils/validators/input/users.js (#13589)
refs: #13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
d362d8c8bd
commit
4943c97ecb
@ -1,7 +1,10 @@
|
|||||||
const Promise = require('bluebird');
|
const Promise = require('bluebird');
|
||||||
const debug = require('@tryghost/debug')('api:v2:utils:validators:input:users');
|
const debug = require('@tryghost/debug')('api:v2:utils:validators:input:users');
|
||||||
const i18n = require('../../../../../../shared/i18n');
|
const tpl = require('@tryghost/tpl');
|
||||||
const errors = require('@tryghost/errors');
|
const errors = require('@tryghost/errors');
|
||||||
|
const messages = {
|
||||||
|
newPasswordsDoNotMatch: 'Your new passwords do not match'
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
changePassword(apiConfig, frame) {
|
changePassword(apiConfig, frame) {
|
||||||
@ -11,7 +14,7 @@ module.exports = {
|
|||||||
|
|
||||||
if (data.newPassword !== data.ne2Password) {
|
if (data.newPassword !== data.ne2Password) {
|
||||||
return Promise.reject(new errors.ValidationError({
|
return Promise.reject(new errors.ValidationError({
|
||||||
message: i18n.t('errors.models.user.newPasswordsDoNotMatch')
|
message: tpl(messages.newPasswordsDoNotMatch)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user