From 311414ad4801e32ff8148f494be481012c94c4f1 Mon Sep 17 00:00:00 2001 From: william chandra Date: Mon, 11 Oct 2021 20:30:05 +0700 Subject: [PATCH] Replaced i18n.t w/ tpl in core/server/api/v3/utils/validators/input/users.js (#13517) refs: #13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/api/v3/utils/validators/input/users.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server/api/v3/utils/validators/input/users.js b/core/server/api/v3/utils/validators/input/users.js index bafec55235..4e764ee31d 100644 --- a/core/server/api/v3/utils/validators/input/users.js +++ b/core/server/api/v3/utils/validators/input/users.js @@ -1,8 +1,12 @@ const Promise = require('bluebird'); const debug = require('@tryghost/debug')('api:v3:utils:validators:input:users'); -const i18n = require('../../../../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); +const messages = { + newPasswordsDoNotMatch: 'Your new passwords do not match' +}; + module.exports = { changePassword(apiConfig, frame) { debug('changePassword'); @@ -11,7 +15,7 @@ module.exports = { if (data.newPassword !== data.ne2Password) { return Promise.reject(new errors.ValidationError({ - message: i18n.t('errors.models.user.newPasswordsDoNotMatch') + message: tpl(messages.newPasswordsDoNotMatch) })); } }