mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Replace i18n with tpl in email-preview.js (#13475)
refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
e9c01d6ebe
commit
e8ad189511
1 changed files with 7 additions and 3 deletions
|
@ -1,8 +1,12 @@
|
||||||
const models = require('../../models');
|
const models = require('../../models');
|
||||||
const i18n = require('../../../shared/i18n');
|
const tpl = require('@tryghost/tpl');
|
||||||
const errors = require('@tryghost/errors');
|
const errors = require('@tryghost/errors');
|
||||||
const mega = require('../../services/mega');
|
const mega = require('../../services/mega');
|
||||||
|
|
||||||
|
const messages = {
|
||||||
|
postNotFound: 'Post not found.'
|
||||||
|
};
|
||||||
|
|
||||||
const emailPreview = new mega.EmailPreview({
|
const emailPreview = new mega.EmailPreview({
|
||||||
apiVersion: 'v3'
|
apiVersion: 'v3'
|
||||||
});
|
});
|
||||||
|
@ -32,7 +36,7 @@ module.exports = {
|
||||||
|
|
||||||
if (!model) {
|
if (!model) {
|
||||||
throw new errors.NotFoundError({
|
throw new errors.NotFoundError({
|
||||||
message: i18n.t('errors.api.posts.postNotFound')
|
message: tpl(messages.postNotFound)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +63,7 @@ module.exports = {
|
||||||
|
|
||||||
if (!model) {
|
if (!model) {
|
||||||
throw new errors.NotFoundError({
|
throw new errors.NotFoundError({
|
||||||
message: i18n.t('errors.api.posts.postNotFound')
|
message: tpl(messages.postNotFound)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue