Replaced hardcoded translation in shared input validator

no issue

- re-use existing keys
This commit is contained in:
kirrg001 2018-12-10 15:23:46 +01:00 committed by Katharina Irrgang
parent 812e533554
commit ccd9541f75

View File

@ -30,7 +30,10 @@ const validate = (config, attrs) => {
_.each(config, (value, key) => {
if (value.required && !attrs[key]) {
errors.push(new common.errors.ValidationError({
message: `${key} is required.`
message: common.i18n.t('notices.data.validation.index.validationFailed', {
validationName: 'FieldIsRequired',
key: key
})
}));
}
});