mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-01 23:37:43 +03:00
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:
parent
0fe62e3aee
commit
af7fe99127
@ -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)
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user