mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
Removed i18n dependency from ensure settings module
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings - i18n is an old pattern we are getting rid of. By removing it here we get rid of an extra dependancy on frontend's "proxy" module
This commit is contained in:
parent
4a47e8d0a8
commit
9822dbc1a2
@ -2,10 +2,14 @@ const fs = require('fs-extra');
|
||||
const Promise = require('bluebird');
|
||||
const path = require('path');
|
||||
const debug = require('@tryghost/debug')('frontend:services:settings:ensure-settings');
|
||||
const {i18n} = require('../proxy');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const errors = require('@tryghost/errors');
|
||||
const config = require('../../../shared/config');
|
||||
|
||||
const messages = {
|
||||
ensureSettings: 'Error trying to access settings files in {path}.'
|
||||
};
|
||||
|
||||
/**
|
||||
* Makes sure file is in the `/content/settings` directory. If not, copy the default over.
|
||||
* @param {String} fileName - name of the setting file
|
||||
@ -31,7 +35,7 @@ module.exports = function ensureSettingsFile(fileName) {
|
||||
}).catch((error) => {
|
||||
// CASE: we might have a permission error, as we can't access the directory
|
||||
throw new errors.GhostError({
|
||||
message: i18n.t('errors.services.settings.ensureSettings', {path: contentPath}),
|
||||
message: tpl(messages.ensureSettings, {path: contentPath}),
|
||||
err: error,
|
||||
context: error.path
|
||||
});
|
||||
|
@ -545,8 +545,7 @@
|
||||
"help": "Check your {file} file for typos and fix the named issues.",
|
||||
"validate": "The following definition \"{at}\" is invalid: {reason}"
|
||||
},
|
||||
"loader": "Error trying to load YAML setting for {setting} from '{path}'.",
|
||||
"ensureSettings": "Error trying to access settings files in {path}."
|
||||
"loader": "Error trying to load YAML setting for {setting} from '{path}'."
|
||||
},
|
||||
"mega": {
|
||||
"requestFailed": {
|
||||
|
Loading…
Reference in New Issue
Block a user