From ab86ffc3492ae12b97ed855218938d5d45777f72 Mon Sep 17 00:00:00 2001 From: ozanuslan Date: Tue, 5 Oct 2021 15:49:22 +0300 Subject: [PATCH] Replaced i18n.t w/ tpl in uncapitalise.js refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/web/shared/middlewares/uncapitalise.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server/web/shared/middlewares/uncapitalise.js b/core/server/web/shared/middlewares/uncapitalise.js index 830a18245e..9c8b644c25 100644 --- a/core/server/web/shared/middlewares/uncapitalise.js +++ b/core/server/web/shared/middlewares/uncapitalise.js @@ -14,9 +14,13 @@ const errors = require('@tryghost/errors'); const urlUtils = require('../../../../shared/url-utils'); -const i18n = require('../../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const localUtils = require('../utils'); +const messages = { + pageNotFound: 'Page not found"' +}; + const uncapitalise = (req, res, next) => { let pathToTest = (req.baseUrl ? req.baseUrl : '') + req.path; let redirectPath; @@ -38,7 +42,7 @@ const uncapitalise = (req, res, next) => { decodedURI = decodeURIComponent(pathToTest); } catch (err) { return next(new errors.NotFoundError({ - message: i18n.t('errors.errors.pageNotFound'), + message: tpl(messages.pageNotFound), err: err })); }