From 3303ce127cfaf566a0fb7ff833bfbee9b8d741f8 Mon Sep 17 00:00:00 2001 From: LucasOe Date: Fri, 8 Oct 2021 16:38:23 +0200 Subject: [PATCH] Replaced i18n.t w/ tpl in v2/oembed.js (#13499) refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/api/v2/oembed.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server/api/v2/oembed.js b/core/server/api/v2/oembed.js index 9a44c3a0a5..2281cf4541 100644 --- a/core/server/api/v2/oembed.js +++ b/core/server/api/v2/oembed.js @@ -4,9 +4,13 @@ const Promise = require('bluebird'); const cheerio = require('cheerio'); const _ = require('lodash'); const config = require('../../../shared/config'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const externalRequest = require('../../lib/request-external'); +const messages = { + unknownProvider: 'No provider found for supplied URL.' +}; + const findUrlWithProvider = (url) => { let provider; @@ -33,7 +37,7 @@ const findUrlWithProvider = (url) => { function unknownProvider(url) { return Promise.reject(new errors.ValidationError({ - message: i18n.t('errors.api.oembed.unknownProvider'), + message: tpl(messages.unknownProvider), context: url })); }