mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-01 23:37:43 +03:00
Replaced i18n.t w/ tpl in api/v2/utils/validators/input/settings.js (#13578)
refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
0cbc813f28
commit
b2e4145bd9
@ -1,8 +1,14 @@
|
||||
const Promise = require('bluebird');
|
||||
const _ = require('lodash');
|
||||
const i18n = require('../../../../../../shared/i18n');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const {BadRequestError, ValidationError} = require('@tryghost/errors');
|
||||
|
||||
const messages = {
|
||||
error: 'Attempted to change active_theme via settings API',
|
||||
help: 'Please activate theme via the themes API endpoints instead',
|
||||
schemaValidationFailed: 'Validation failed for \'{key}\'.'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
edit(apiConfig, frame) {
|
||||
const errors = [];
|
||||
@ -12,8 +18,8 @@ module.exports = {
|
||||
// @NOTE: active theme has to be changed via theme endpoints
|
||||
errors.push(
|
||||
new BadRequestError({
|
||||
message: i18n.t('errors.api.settings.activeThemeSetViaAPI.error'),
|
||||
help: i18n.t('errors.api.settings.activeThemeSetViaAPI.help')
|
||||
message: tpl(messages.error),
|
||||
help: tpl(messages.help)
|
||||
})
|
||||
);
|
||||
}
|
||||
@ -25,7 +31,7 @@ module.exports = {
|
||||
} catch (e) {
|
||||
errors.push(
|
||||
new ValidationError({
|
||||
message: i18n.t('notices.data.validation.index.schemaValidationFailed', {
|
||||
message: tpl(messages.schemaValidationFailed, {
|
||||
key: 'unsplash'
|
||||
}),
|
||||
property: 'unsplash'
|
||||
|
Loading…
Reference in New Issue
Block a user