mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 16:38:22 +03:00
Refactored i18n out of custom redirects middleware
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings - i18n is an old pattern we are getting rid of
This commit is contained in:
parent
3965e8051b
commit
dc051eb21a
@ -5,11 +5,14 @@ const debug = require('@tryghost/debug')('web:shared:mw:custom-redirects');
|
||||
const config = require('../../../../shared/config');
|
||||
const urlUtils = require('../../../../shared/url-utils');
|
||||
const errors = require('@tryghost/errors');
|
||||
const i18n = require('../../../../shared/i18n');
|
||||
const logging = require('@tryghost/logging');
|
||||
const redirectsService = require('../../../services/redirects');
|
||||
const labsService = require('../../../../shared/labs');
|
||||
|
||||
const messages = {
|
||||
customRedirectsRegistrationFailure: 'Could not register custom redirects.'
|
||||
};
|
||||
|
||||
const _private = {};
|
||||
|
||||
let customRedirectsRouter;
|
||||
@ -90,7 +93,7 @@ _private.registerRoutes = () => {
|
||||
logging.error(err);
|
||||
} else {
|
||||
logging.error(new errors.IncorrectUsageError({
|
||||
message: i18n.t('errors.middleware.redirects.register'),
|
||||
message: messages.customRedirectsRegistrationFailure,
|
||||
context: err.message,
|
||||
help: 'https://ghost.org/docs/themes/routing/#redirects',
|
||||
err
|
||||
|
Loading…
Reference in New Issue
Block a user