0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Switched frontend i18n requires to go through proxy

- we export i18n from `core/frontend/services/proxy` and this is used in
  the most of the places in the frontend code
- this commit aligns the rest of the code in core/frontend to use the
  proxy too
- unfortunately core/frontend/services/themes/i18n.js loops back to the
  proxy so we have a circular dependency
This commit is contained in:
Daniel Lockyer 2020-11-25 12:33:44 +00:00
parent dcafebe379
commit 40064a395a
14 changed files with 15 additions and 19 deletions

View file

@ -9,12 +9,7 @@
const Promise = require('bluebird');
const moment = require('moment');
const proxy = require('../../../../services/proxy');
const SafeString = proxy.SafeString;
const logging = proxy.logging;
const i18n = proxy.i18n;
const errors = proxy.errors;
const urlUtils = proxy.urlUtils;
const {SafeString, logging, i18n, errors, urlUtils} = require('../../../../services/proxy');
const amperizeCache = {};
let allowedAMPTags = [];
let allowedAMPAttributes = {};

View file

@ -3,7 +3,7 @@ const express = require('../../../../shared/express');
const ampRouter = express.Router('amp');
// Dirty requires
const {i18n} = require('../../../../server/lib/common');
const {i18n} = require('../../../services/proxy');
const errors = require('@tryghost/errors');
const urlService = require('../../../services/url');

View file

@ -1,4 +1,4 @@
const {i18n} = require('../../../server/lib/common');
const {i18n} = require('../../services/proxy');
const urlUtils = require('../../../shared/url-utils');
const logging = require('../../../shared/logging');
const errors = require('@tryghost/errors');

View file

@ -6,7 +6,7 @@ const path = require('path');
const config = require('../../../../shared/config');
const urlUtils = require('../../../../shared/url-utils');
const constants = require('@tryghost/constants');
const {i18n} = require('../../../../server/lib/common');
const {i18n} = require('../../../services/proxy');
const errors = require('@tryghost/errors');
const settingsCache = require('../../../../server/services/settings/cache');
// routeKeywords.private: 'private'

View file

@ -1,6 +1,6 @@
const _ = require('lodash');
const debug = require('ghost-ignition').debug('services:routing:controllers:collection');
const {i18n} = require('../../../../server/lib/common');
const {i18n} = require('../../proxy');
const errors = require('@tryghost/errors');
const security = require('@tryghost/security');
const urlService = require('../../url');

View file

@ -2,7 +2,7 @@ const fs = require('fs-extra');
const Promise = require('bluebird');
const path = require('path');
const debug = require('ghost-ignition').debug('frontend:services:settings:ensure-settings');
const {i18n} = require('../../../server/lib/common');
const {i18n} = require('../proxy');
const errors = require('@tryghost/errors');
const config = require('../../../shared/config');

View file

@ -1,7 +1,7 @@
const fs = require('fs-extra');
const path = require('path');
const debug = require('ghost-ignition').debug('frontend:services:settings:settings-loader');
const {i18n} = require('../../../server/lib/common');
const {i18n} = require('../proxy');
const errors = require('@tryghost/errors');
const config = require('../../../shared/config');
const yamlParser = require('./yaml-parser');

View file

@ -1,6 +1,6 @@
const _ = require('lodash');
const debug = require('ghost-ignition').debug('frontend:services:settings:validate');
const {i18n} = require('../../../server/lib/common');
const {i18n} = require('../proxy');
const errors = require('@tryghost/errors');
const themeService = require('../themes');
const _private = {};

View file

@ -1,6 +1,6 @@
const yaml = require('js-yaml');
const debug = require('ghost-ignition').debug('frontend:services:settings:yaml-parser');
const {i18n} = require('../../../server/lib/common');
const {i18n} = require('../proxy');
const errors = require('@tryghost/errors');
/**

View file

@ -3,7 +3,7 @@ const templates = {};
const _ = require('lodash');
const errors = require('@tryghost/errors');
const hbs = require('../engine');
const {i18n} = require('../../../../server/lib/common');
const {i18n} = require('../../proxy');
// Execute a template helper
// All template helpers are register as partial view.

View file

@ -1,6 +1,7 @@
const _ = require('lodash');
const debug = require('ghost-ignition').debug('themes');
const {events, i18n: commonI18n} = require('../../../server/lib/common');
const {events} = require('../../../server/lib/common');
const {i18n: commonI18n} = require('../proxy');
const logging = require('../../../shared/logging');
const errors = require('@tryghost/errors');
const themeLoader = require('./loader');

View file

@ -2,7 +2,7 @@ const _ = require('lodash');
const hbs = require('./engine');
const urlUtils = require('../../../shared/url-utils');
const config = require('../../../shared/config');
const {i18n} = require('../../../server/lib/common');
const {i18n} = require('../proxy');
const errors = require('@tryghost/errors');
const settingsCache = require('../../../server/services/settings/cache');
const labs = require('../../../server/services/labs');

View file

@ -8,7 +8,7 @@ const themeLoader = require('./loader');
const toJSON = require('./to-json');
const settingsCache = require('../../../server/services/settings/cache');
const {i18n} = require('../../../server/lib/common');
const {i18n} = require('../proxy');
const logging = require('../../../shared/logging');
const errors = require('@tryghost/errors');
const debug = require('ghost-ignition').debug('api:themes');

View file

@ -2,7 +2,7 @@ const _ = require('lodash');
const Promise = require('bluebird');
const fs = require('fs-extra');
const config = require('../../../shared/config');
const {i18n} = require('../../../server/lib/common');
const {i18n} = require('../proxy');
const errors = require('@tryghost/errors');
const canActivate = function canActivate(checkedTheme) {