mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-09-23 10:57:26 +03:00
Replaced i18n.t w/ tpl in api/v3/utils/validators/input/settings.js (#13533)
refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
cef32dd1fe
commit
7c14ff903b
@ -1,12 +1,13 @@
|
|||||||
const Promise = require('bluebird');
|
const Promise = require('bluebird');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const i18n = require('../../../../../../shared/i18n');
|
const tpl = require('@tryghost/tpl');
|
||||||
const {NotFoundError, ValidationError, BadRequestError} = require('@tryghost/errors');
|
const {NotFoundError, ValidationError, BadRequestError} = require('@tryghost/errors');
|
||||||
const validator = require('@tryghost/validator');
|
const validator = require('@tryghost/validator');
|
||||||
|
|
||||||
const messages = {
|
const messages = {
|
||||||
invalidEmailReceived: 'Please send a valid email',
|
invalidEmailReceived: 'Please send a valid email',
|
||||||
invalidEmailTypeReceived: 'Invalid email type received'
|
invalidEmailTypeReceived: 'Invalid email type received',
|
||||||
|
problemFindingSetting: 'Problem finding setting: {key}'
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@ -14,7 +15,7 @@ module.exports = {
|
|||||||
// @NOTE: was removed https://github.com/TryGhost/Ghost/issues/10373
|
// @NOTE: was removed https://github.com/TryGhost/Ghost/issues/10373
|
||||||
if (frame.options.key === 'ghost_head' || frame.options.key === 'ghost_foot') {
|
if (frame.options.key === 'ghost_head' || frame.options.key === 'ghost_foot') {
|
||||||
return Promise.reject(new NotFoundError({
|
return Promise.reject(new NotFoundError({
|
||||||
message: i18n.t('errors.api.settings.problemFindingSetting', {
|
message: tpl(messages.problemFindingSetting, {
|
||||||
key: frame.options.key
|
key: frame.options.key
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
@ -28,7 +29,7 @@ module.exports = {
|
|||||||
if (setting.key === 'ghost_head' || setting.key === 'ghost_foot') {
|
if (setting.key === 'ghost_head' || setting.key === 'ghost_foot') {
|
||||||
// @NOTE: was removed https://github.com/TryGhost/Ghost/issues/10373
|
// @NOTE: was removed https://github.com/TryGhost/Ghost/issues/10373
|
||||||
errors.push(new NotFoundError({
|
errors.push(new NotFoundError({
|
||||||
message: i18n.t('errors.api.settings.problemFindingSetting', {
|
message: tpl(messages.problemFindingSetting, {
|
||||||
key: setting.key
|
key: setting.key
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user