From 68de391c989c6cbf841df365da2ae439932249e0 Mon Sep 17 00:00:00 2001 From: Ozan Uslan Date: Wed, 6 Oct 2021 01:24:41 +0300 Subject: [PATCH] Replaced i18n.t w/ tpl in invites.js for `canary` refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/api/canary/utils/validators/input/invites.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server/api/canary/utils/validators/input/invites.js b/core/server/api/canary/utils/validators/input/invites.js index 7bb6eb9053..88d8737562 100644 --- a/core/server/api/canary/utils/validators/input/invites.js +++ b/core/server/api/canary/utils/validators/input/invites.js @@ -1,15 +1,19 @@ const Promise = require('bluebird'); -const i18n = require('../../../../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const models = require('../../../../../models'); +const messages = { + userAlreadyRegistered: 'User is already registered.' +}; + module.exports = { add(apiConfig, frame) { return models.User.findOne({email: frame.data.invites[0].email}, frame.options) .then((user) => { if (user) { return Promise.reject(new errors.ValidationError({ - message: i18n.t('errors.api.users.userAlreadyRegistered') + message: tpl(messages.userAlreadyRegistered) })); } });