diff --git a/config/vufind/FeedbackForms.yaml b/config/vufind/FeedbackForms.yaml index b0f7cb4519fc62df4bd16e967f270266d92ee649..445644fb95644f8639ca358702ad9a9a47a21452 100644 --- a/config/vufind/FeedbackForms.yaml +++ b/config/vufind/FeedbackForms.yaml @@ -67,8 +67,8 @@ # placeholder (string) Placeholder label (translation key). Used to instruct or force # (when combined with 'required' attribute) the user to make a selection from the # options-list. Only select elements with 'options' are supported. -# For text, textarea, email and url elements, a placeholder text can be configured -# by adding a HTML-attribute via 'settings', for example: +# For text, textarea, email and url elements, a placeholder text (translation key) +# can be configured by adding a HTML-attribute via 'settings', for example: # settings: # - [placeholder, Please select...] # diff --git a/module/VuFind/src/VuFind/Form/Form.php b/module/VuFind/src/VuFind/Form/Form.php index 3b937d1c1cd0e33b9986aa3241dda016a02ba5ae..327726d5c9ae5dc81fb4c09bec4f8a2db30f515d 100644 --- a/module/VuFind/src/VuFind/Form/Form.php +++ b/module/VuFind/src/VuFind/Form/Form.php @@ -291,7 +291,12 @@ class Form extends \Zend\Form\Form implements $settings = []; if (isset($el['settings'])) { foreach ($el['settings'] as list($settingId, $settingVal)) { - $settings[trim($settingId)] = trim($settingVal); + $settingId = trim($settingId); + $settingVal = trim($settingVal); + if ($settingId === 'placeholder') { + $settingVal = $this->translate($settingVal); + } + $settings[$settingId] = $settingVal; } $element['settings'] = $settings; }