0
Fork 0
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:
Deeksha Agrawal 2021-10-07 13:52:32 +05:30 committed by GitHub
parent e9c01d6ebe
commit e8ad189511
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: 'v3'
});
@ -32,7 +36,7 @@ module.exports = {
if (!model) {
throw new errors.NotFoundError({
message: i18n.t('errors.api.posts.postNotFound')
message: tpl(messages.postNotFound)
});
}
@ -59,7 +63,7 @@ module.exports = {
if (!model) {
throw new errors.NotFoundError({
message: i18n.t('errors.api.posts.postNotFound')
message: tpl(messages.postNotFound)
});
}