From 03f523f8c25254f32e5b7d55e74b5c1b857cfebc Mon Sep 17 00:00:00 2001 From: Philipp Dieter Date: Mon, 19 Jul 2021 23:17:01 +0200 Subject: [PATCH] [TASK] Add automated translation for required fields --- Classes/Controller/ActionController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Classes/Controller/ActionController.php b/Classes/Controller/ActionController.php index e5599f1..3ecafa6 100644 --- a/Classes/Controller/ActionController.php +++ b/Classes/Controller/ActionController.php @@ -544,6 +544,14 @@ class ActionController extends BaseController $errorLabel = $this->getTranslation( 'error.' . $field . '.required' ); + if ($errorLabel == null) { + $fieldLabel = $this->getTranslation( + 'field.' . $field + ); + $errorLabel = $this->getTranslation( + 'error.required', [$fieldLabel] + ); + } if ($errorLabel == null) { $errorLabel = 'error.' . $field