From af7fe9912728bba4a5cc4142ea0ee59477579a32 Mon Sep 17 00:00:00 2001 From: ItsMeSatan <79689263+ItsMeSatan@users.noreply.github.com> Date: Tue, 12 Oct 2021 15:47:53 +0200 Subject: [PATCH] Replaced i18n.t with tpl in memberSigninUrls.js and oembed.js (#13564) refs: #13380 - i18n is deprecated and is being replaced with tpl --- core/server/api/v2/utils/validators/input/oembed.js | 8 ++++++-- core/server/api/v3/memberSigninUrls.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/core/server/api/v2/utils/validators/input/oembed.js b/core/server/api/v2/utils/validators/input/oembed.js index b96b8ff842..5db993458e 100644 --- a/core/server/api/v2/utils/validators/input/oembed.js +++ b/core/server/api/v2/utils/validators/input/oembed.js @@ -1,12 +1,16 @@ const Promise = require('bluebird'); -const i18n = require('../../../../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); +const messages = { + noUrlProvided: 'No url provided.' +}; + module.exports = { read(apiConfig, frame) { if (!frame.data.url || !frame.data.url.trim()) { return Promise.reject(new errors.BadRequestError({ - message: i18n.t('errors.api.oembed.noUrlProvided') + message: tpl(messages.noUrlProvided) })); } } diff --git a/core/server/api/v3/memberSigninUrls.js b/core/server/api/v3/memberSigninUrls.js index b4e14a7bd8..9f435fc165 100644 --- a/core/server/api/v3/memberSigninUrls.js +++ b/core/server/api/v3/memberSigninUrls.js @@ -1,7 +1,11 @@ -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const membersService = require('../../services/members'); +const messages = { + memberNotFound: 'Member not found.' +}; + module.exports = { docName: 'member_signin_urls', permissions: true, @@ -15,7 +19,7 @@ module.exports = { if (!model) { throw new errors.NotFoundError({ - message: i18n.t('errors.api.members.memberNotFound') + message: tpl(messages.memberNotFound) }); }