diff --git a/core/server/services/permissions/providers.js b/core/server/services/permissions/providers.js index dcebe7b144..539768f763 100644 --- a/core/server/services/permissions/providers.js +++ b/core/server/services/permissions/providers.js @@ -2,7 +2,12 @@ const _ = require('lodash'); const Promise = require('bluebird'); const models = require('../../models'); const errors = require('@tryghost/errors'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); + +const messages = { + userNotFound: 'User not found', + apiKeyNotFound: 'API Key not found' +}; module.exports = { user: function (id) { @@ -11,7 +16,7 @@ module.exports = { // CASE: {context: {user: id}} where the id is not in our database if (!foundUser) { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.models.user.userNotFound') + message: tpl(messages.userNotFound) })); } @@ -56,7 +61,7 @@ module.exports = { .then((foundApiKey) => { if (!foundApiKey) { throw new errors.NotFoundError({ - message: i18n.t('errors.models.api_key.apiKeyNotFound') + message: tpl(messages.apiKeyNotFound) }); }