diff --git a/core/server/api/v2/tags-public.js b/core/server/api/v2/tags-public.js index ce9dc91a6e..081dc9e984 100644 --- a/core/server/api/v2/tags-public.js +++ b/core/server/api/v2/tags-public.js @@ -1,10 +1,14 @@ const Promise = require('bluebird'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const models = require('../../models'); const ALLOWED_INCLUDES = ['count.posts']; +const messages = { + tagNotFound: 'Tag not found.' +}; + module.exports = { docName: 'tags', @@ -56,7 +60,7 @@ module.exports = { .then((model) => { if (!model) { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.api.tags.tagNotFound') + message: tpl(messages.tagNotFound) })); } diff --git a/core/server/api/v2/tags.js b/core/server/api/v2/tags.js index f9679b961e..2de713c0d8 100644 --- a/core/server/api/v2/tags.js +++ b/core/server/api/v2/tags.js @@ -1,10 +1,14 @@ const Promise = require('bluebird'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const models = require('../../models'); const ALLOWED_INCLUDES = ['count.posts']; +const messages = { + tagNotFound: 'Tag not found.' +}; + module.exports = { docName: 'tags', @@ -56,7 +60,7 @@ module.exports = { .then((model) => { if (!model) { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.api.tags.tagNotFound') + message: tpl(messages.tagNotFound) })); } @@ -108,7 +112,7 @@ module.exports = { .then((model) => { if (!model) { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.api.tags.tagNotFound') + message: tpl(messages.tagNotFound) })); } @@ -147,7 +151,7 @@ module.exports = { .then(() => null) .catch(models.Tag.NotFoundError, () => { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.api.tags.tagNotFound') + message: tpl(messages.tagNotFound) })); }); } diff --git a/core/server/api/v3/tags-public.js b/core/server/api/v3/tags-public.js index ce9dc91a6e..081dc9e984 100644 --- a/core/server/api/v3/tags-public.js +++ b/core/server/api/v3/tags-public.js @@ -1,10 +1,14 @@ const Promise = require('bluebird'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const models = require('../../models'); const ALLOWED_INCLUDES = ['count.posts']; +const messages = { + tagNotFound: 'Tag not found.' +}; + module.exports = { docName: 'tags', @@ -56,7 +60,7 @@ module.exports = { .then((model) => { if (!model) { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.api.tags.tagNotFound') + message: tpl(messages.tagNotFound) })); } diff --git a/core/server/api/v3/tags.js b/core/server/api/v3/tags.js index f9679b961e..2de713c0d8 100644 --- a/core/server/api/v3/tags.js +++ b/core/server/api/v3/tags.js @@ -1,10 +1,14 @@ const Promise = require('bluebird'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const models = require('../../models'); const ALLOWED_INCLUDES = ['count.posts']; +const messages = { + tagNotFound: 'Tag not found.' +}; + module.exports = { docName: 'tags', @@ -56,7 +60,7 @@ module.exports = { .then((model) => { if (!model) { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.api.tags.tagNotFound') + message: tpl(messages.tagNotFound) })); } @@ -108,7 +112,7 @@ module.exports = { .then((model) => { if (!model) { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.api.tags.tagNotFound') + message: tpl(messages.tagNotFound) })); } @@ -147,7 +151,7 @@ module.exports = { .then(() => null) .catch(models.Tag.NotFoundError, () => { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.api.tags.tagNotFound') + message: tpl(messages.tagNotFound) })); }); }