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:
parent
5438644a51
commit
554f36de55
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
}));
|
||||
|
|
Loading…
Add table
Reference in a new issue