From ea346d5d224c92ac02ed5435c36c9ccb0bad3bd0 Mon Sep 17 00:00:00 2001 From: LucasOe Date: Fri, 8 Oct 2021 16:39:15 +0200 Subject: [PATCH] Replaced i18n.t w/ tpl in v2/posts-public.js (#13501) refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/api/v2/posts-public.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server/api/v2/posts-public.js b/core/server/api/v2/posts-public.js index d4fa618639..437dbc1a89 100644 --- a/core/server/api/v2/posts-public.js +++ b/core/server/api/v2/posts-public.js @@ -1,8 +1,12 @@ const models = require('../../models'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const allowedIncludes = ['tags', 'authors']; +const messages = { + postNotFound: 'Post not found.' +}; + module.exports = { docName: 'posts', @@ -63,7 +67,7 @@ module.exports = { .then((model) => { if (!model) { throw new errors.NotFoundError({ - message: i18n.t('errors.api.posts.postNotFound') + message: tpl(messages.postNotFound) }); }