From a62c7acde20505ceed6fc4c032ddbbbffdc80157 Mon Sep 17 00:00:00 2001 From: william chandra Date: Mon, 11 Oct 2021 19:59:40 +0700 Subject: [PATCH] Replaced i18n.t w/ tpl in core/server/api/v3/utils/validators/input/oembed.js (#13516) refs: #13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/api/v3/utils/validators/input/oembed.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server/api/v3/utils/validators/input/oembed.js b/core/server/api/v3/utils/validators/input/oembed.js index b96b8ff842..5db993458e 100644 --- a/core/server/api/v3/utils/validators/input/oembed.js +++ b/core/server/api/v3/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) })); } }