0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Replaced i18n.t w/ tpl helper in serve-public-file.js (#13429)

refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
Gustavo Hernández 2021-10-05 04:00:28 -05:00 committed by GitHub
parent 5438644a51
commit 554f36de55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}));