From 940d10fc3b5263de270affcb0a4c2a14eddb6ff3 Mon Sep 17 00:00:00 2001 From: PJ <43812132+pegjee@users.noreply.github.com> Date: Sat, 9 Oct 2021 01:20:41 +1100 Subject: [PATCH] Replaced i18n with tpl in oembed.js (#13472) refs: #13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/api/canary/utils/validators/input/oembed.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/server/api/canary/utils/validators/input/oembed.js b/core/server/api/canary/utils/validators/input/oembed.js index b96b8ff842..0b8eca2bd1 100644 --- a/core/server/api/canary/utils/validators/input/oembed.js +++ b/core/server/api/canary/utils/validators/input/oembed.js @@ -1,12 +1,13 @@ 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) })); } }