Replaced i18n with tpl in oembed.js (#13472)

refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
PJ 2021-10-09 01:20:41 +11:00 committed by GitHub
parent 3255c806f8
commit 940d10fc3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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