From 12a839b29fd8e42f48141572a07e15daee238daa Mon Sep 17 00:00:00 2001 From: Ozan Uslan Date: Mon, 4 Oct 2021 19:06:49 +0300 Subject: [PATCH] Replaced i18n.t w/ tpl in middleware.js in `api/v2/admin` refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/web/api/v2/admin/middleware.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server/web/api/v2/admin/middleware.js b/core/server/web/api/v2/admin/middleware.js index 83f76fe105..5d2cf5edc4 100644 --- a/core/server/web/api/v2/admin/middleware.js +++ b/core/server/web/api/v2/admin/middleware.js @@ -1,9 +1,13 @@ const errors = require('@tryghost/errors'); -const i18n = require('../../../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const auth = require('../../../../services/auth'); const shared = require('../../../shared'); const apiMw = require('../../middleware'); +const messages = { + notImplemented: 'The server does not support the functionality required to fulfill the request.' +}; + const notImplemented = function (req, res, next) { // CASE: user is logged in, allow if (!req.api_key) { @@ -38,7 +42,7 @@ const notImplemented = function (req, res, next) { next(new errors.GhostError({ errorType: 'NotImplementedError', - message: i18n.t('errors.api.common.notImplemented'), + message: tpl(messages.notImplemented), statusCode: '501' })); };