From 5ec272a377841e727ef5a665194004f69d337787 Mon Sep 17 00:00:00 2001 From: LucasOe Date: Fri, 8 Oct 2021 16:40:22 +0200 Subject: [PATCH] Replaced i18n.t w/ tpl in v2/preview.js (#13503) refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/api/v2/preview.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server/api/v2/preview.js b/core/server/api/v2/preview.js index 758977fcc2..a97bcbc87e 100644 --- a/core/server/api/v2/preview.js +++ b/core/server/api/v2/preview.js @@ -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: 'preview', @@ -31,7 +35,7 @@ module.exports = { .then((model) => { if (!model) { throw new errors.NotFoundError({ - message: i18n.t('errors.api.posts.postNotFound') + message: tpl(messages.postNotFound) }); }