diff --git a/system/languages/en.yaml b/system/languages/en.yaml index a1eab6f19..654c0d3e5 100644 --- a/system/languages/en.yaml +++ b/system/languages/en.yaml @@ -95,3 +95,4 @@ NICETIME: FORM: VALIDATION_FAIL: Validation failed: INVALID_INPUT: Invalid input in + MISSING_REQUIRED_FIELD: Missing required field: diff --git a/system/languages/es.yaml b/system/languages/es.yaml new file mode 100644 index 000000000..41df5d55b --- /dev/null +++ b/system/languages/es.yaml @@ -0,0 +1,42 @@ +NICETIME: + NO_DATE_PROVIDED: No se proporcionó fecha + BAD_DATE: Fecha erronea + AGO: antes + FROM_NOW: desde ahora + SECOND: segundo + MINUTE: minuto + HOUR: hora + DAY: dia + WEEK: semana + MONTH: mes + YEAR: año + DECADE: decada + SEC: seg + MIN: min + HR: hr + DAY: dia + WK: sem + MO: mes + YR: yr + DEC: dec + SECOND_PLURAL: segundos + MINUTE_PLURAL: minutos + HOUR_PLURAL: horas + DAY_PLURAL: días + WEEK_PLURAL: semanas + MONTH_PLURAL: meses + YEAR_PLURAL: años + DECADE_PLURAL: decadas + SEC_PLURAL: segs + MIN_PLURAL: mins + HR_PLURAL: hrs + DAY_PLURAL: dias + WK_PLURAL: sem + MO_PLURAL: mes + YR_PLURAL: años + DEC_PLURAL: decs +FORM: + VALIDATION_FAIL: Falló la validación. + INVALID_INPUT: "Dato inválido en: " + MISSING_REQUIRED_FIELD: "Falta el campo requerido: " + diff --git a/system/src/Grav/Common/Data/Blueprint.php b/system/src/Grav/Common/Data/Blueprint.php index 3e1dc1f09..8be6a8ea8 100644 --- a/system/src/Grav/Common/Data/Blueprint.php +++ b/system/src/Grav/Common/Data/Blueprint.php @@ -465,7 +465,9 @@ class Blueprint implements \ArrayAccess, ExportInterface && $field['validate']['required'] === true && empty($data[$name])) { $value = isset($field['label']) ? $field['label'] : $field['name']; - throw new \RuntimeException("Missing required field: {$value}"); + $language = self::getGrav()['language']; + $message = sprintf($language->translate('FORM.MISSING_REQUIRED_FIELD', null, true) . ' %s', $value); + throw new \RuntimeException($message); } } }