diff --git a/core/server/web/site/middleware/serve-public-file.js b/core/server/web/site/middleware/serve-public-file.js index 5873fb5f86..9395583898 100644 --- a/core/server/web/site/middleware/serve-public-file.js +++ b/core/server/web/site/middleware/serve-public-file.js @@ -4,7 +4,11 @@ const path = require('path'); const errors = require('@tryghost/errors'); const config = require('../../../../shared/config'); const urlUtils = require('../../../../shared/url-utils'); -const i18n = require('../../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); + +const messages = { + imageNotFound: 'Image not found' +}; function createPublicFileMiddleware(file, type, maxAge) { let content; @@ -24,7 +28,7 @@ function createPublicFileMiddleware(file, type, maxAge) { if (err && err.status === 404) { // ensure we're triggering basic asset 404 and not a templated 404 return next(new errors.NotFoundError({ - message: i18n.t('errors.errors.imageNotFound'), + message: tpl(messages.imageNotFound), code: 'STATIC_FILE_NOT_FOUND', property: err.path }));