mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-04 17:04:59 +03:00
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:
parent
e1bcd422f5
commit
3303ce127c
@ -4,9 +4,13 @@ const Promise = require('bluebird');
|
|||||||
const cheerio = require('cheerio');
|
const cheerio = require('cheerio');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const config = require('../../../shared/config');
|
const config = require('../../../shared/config');
|
||||||
const i18n = require('../../../shared/i18n');
|
const tpl = require('@tryghost/tpl');
|
||||||
const externalRequest = require('../../lib/request-external');
|
const externalRequest = require('../../lib/request-external');
|
||||||
|
|
||||||
|
const messages = {
|
||||||
|
unknownProvider: 'No provider found for supplied URL.'
|
||||||
|
};
|
||||||
|
|
||||||
const findUrlWithProvider = (url) => {
|
const findUrlWithProvider = (url) => {
|
||||||
let provider;
|
let provider;
|
||||||
|
|
||||||
@ -33,7 +37,7 @@ const findUrlWithProvider = (url) => {
|
|||||||
|
|
||||||
function unknownProvider(url) {
|
function unknownProvider(url) {
|
||||||
return Promise.reject(new errors.ValidationError({
|
return Promise.reject(new errors.ValidationError({
|
||||||
message: i18n.t('errors.api.oembed.unknownProvider'),
|
message: tpl(messages.unknownProvider),
|
||||||
context: url
|
context: url
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user