From cb4915aed1b0175d562b6892616d8fbfbdbc2983 Mon Sep 17 00:00:00 2001 From: Ozan Uslan Date: Mon, 4 Oct 2021 19:06:36 +0300 Subject: [PATCH] Replaced i18n.t w/ tpl in middleware.js in `api/canary/admin` refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/web/api/canary/admin/middleware.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server/web/api/canary/admin/middleware.js b/core/server/web/api/canary/admin/middleware.js index 0b64dab04f..c7a277659a 100644 --- a/core/server/web/api/canary/admin/middleware.js +++ b/core/server/web/api/canary/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) { @@ -42,7 +46,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' })); };