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.
This commit is contained in:
LucasOe 2021-10-08 16:38:23 +02:00 committed by GitHub
parent e1bcd422f5
commit 3303ce127c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}));
}