Replaced i18n.t with tpl in memberSigninUrls.js and oembed.js (#13564)

refs: #13380

- i18n is deprecated and is being replaced with tpl
This commit is contained in:
ItsMeSatan 2021-10-12 15:47:53 +02:00 committed by GitHub
parent 0fe62e3aee
commit af7fe99127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -1,12 +1,16 @@
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)
}));
}
}

View File

@ -1,7 +1,11 @@
const i18n = require('../../../shared/i18n');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const membersService = require('../../services/members');
const messages = {
memberNotFound: 'Member not found.'
};
module.exports = {
docName: 'member_signin_urls',
permissions: true,
@ -15,7 +19,7 @@ module.exports = {
if (!model) {
throw new errors.NotFoundError({
message: i18n.t('errors.api.members.memberNotFound')
message: tpl(messages.memberNotFound)
});
}