Replaced i18n.t w/ tpl helper in email-post.js and email-preview.js (#13418)
refs: #13380 - this is to replace i18n.t with tpl because i18n.t is deprecated - Replaced i18n.t with tpl helper in email-post.js - Replaced i18n.t with tpl helper in email-preview.js
This commit is contained in:
parent
4e4d092988
commit
1e73f0b07a
@ -1,8 +1,12 @@
|
||||
const i18n = require('../../../shared/i18n');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const errors = require('@tryghost/errors');
|
||||
const models = require('../../models');
|
||||
const ALLOWED_INCLUDES = ['authors', 'tags'];
|
||||
|
||||
const messages = {
|
||||
postNotFound: 'Post not found.'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
docName: 'email_post',
|
||||
|
||||
@ -31,7 +35,7 @@ module.exports = {
|
||||
|
||||
if (!model) {
|
||||
throw new errors.NotFoundError({
|
||||
message: i18n.t('errors.api.posts.postNotFound')
|
||||
message: tpl(messages.postNotFound)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,12 @@
|
||||
const models = require('../../models');
|
||||
const i18n = require('../../../shared/i18n');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const errors = require('@tryghost/errors');
|
||||
const mega = require('../../services/mega');
|
||||
|
||||
const messages = {
|
||||
postNotFound: 'Post not found.'
|
||||
};
|
||||
|
||||
const emailPreview = new mega.EmailPreview({
|
||||
apiVersion: 'canary'
|
||||
});
|
||||
@ -33,7 +37,7 @@ module.exports = {
|
||||
|
||||
if (!model) {
|
||||
throw new errors.NotFoundError({
|
||||
message: i18n.t('errors.api.posts.postNotFound')
|
||||
message: tpl(messages.postNotFound)
|
||||
});
|
||||
}
|
||||
|
||||
@ -60,7 +64,7 @@ module.exports = {
|
||||
|
||||
if (!model) {
|
||||
throw new errors.NotFoundError({
|
||||
message: i18n.t('errors.api.posts.postNotFound')
|
||||
message: tpl(messages.postNotFound)
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user