mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Replaced i18n.t w/ tpl in v3/settings.js (#13551)
refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
c1789a3a03
commit
8029d1ce6a
@ -2,11 +2,16 @@ const Promise = require('bluebird');
|
||||
const _ = require('lodash');
|
||||
const models = require('../../models');
|
||||
const routeSettings = require('../../services/route-settings');
|
||||
const i18n = require('../../../shared/i18n');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const {BadRequestError, NoPermissionError} = require('@tryghost/errors');
|
||||
const settingsService = require('../../services/settings');
|
||||
const membersService = require('../../services/members');
|
||||
|
||||
const messages = {
|
||||
error: 'Failed to send email.',
|
||||
accessCoreSettingFromExtReq: 'Attempted to access core setting from external request'
|
||||
};
|
||||
|
||||
const settingsBREADService = settingsService.getSettingsBREADServiceInstance();
|
||||
|
||||
module.exports = {
|
||||
@ -109,7 +114,7 @@ module.exports = {
|
||||
} catch (err) {
|
||||
throw new BadRequestError({
|
||||
err,
|
||||
message: i18n.t('errors.mail.failedSendingEmail.error')
|
||||
message: tpl(messages.error)
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -162,7 +167,7 @@ module.exports = {
|
||||
const firstCoreSetting = frame.data.settings.find(setting => setting.group === 'core');
|
||||
if (firstCoreSetting) {
|
||||
throw new NoPermissionError({
|
||||
message: i18n.t('errors.api.settings.accessCoreSettingFromExtReq')
|
||||
message: tpl(messages.accessCoreSettingFromExtReq)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user