Commit 6e39f483 authored by alexpott's avatar alexpott Committed by catch

Issue #2991149 by eliclaggett, Angélique Valvandrin, prashantgajare,...

Issue #2991149 by eliclaggett, Angélique Valvandrin, prashantgajare, andrewmacpherson, nod_, DuaelFr, TwoD, alexpott, Manuel Garcia, mgifford, seangambierross, jhodgdon, Kolin, dat deaf drupaler: Improve placeholder text for image upload

(cherry picked from commit 36ff61a7)
parent 12737b3c
...@@ -141,7 +141,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Editor $e ...@@ -141,7 +141,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Editor $e
} }
$form['attributes']['alt'] = [ $form['attributes']['alt'] = [
'#title' => $this->t('Alternative text'), '#title' => $this->t('Alternative text'),
'#placeholder' => $this->t('Short description for the visually impaired'), '#description' => $this->t('Short description of the image used by screen readers and displayed when the image is not loaded. This is important for accessibility.'),
'#type' => 'textfield', '#type' => 'textfield',
'#required' => TRUE, '#required' => TRUE,
'#required_error' => $this->t('Alternative text is required.<br />(Only in rare cases should this be left empty. To create empty alternative text, enter <code>""</code> — two double quotes without any content).'), '#required_error' => $this->t('Alternative text is required.<br />(Only in rare cases should this be left empty. To create empty alternative text, enter <code>""</code> — two double quotes without any content).'),
......
...@@ -263,7 +263,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) { ...@@ -263,7 +263,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => t('Enable <em>Alt</em> field'), '#title' => t('Enable <em>Alt</em> field'),
'#default_value' => $settings['alt_field'], '#default_value' => $settings['alt_field'],
'#description' => t('The alt attribute may be used by search engines, screen readers, and when the image cannot be loaded. Enabling this field is recommended.'), '#description' => t('Short description of the image used by screen readers and displayed when the image is not loaded. Enabling this field is recommended.'),
'#weight' => 9, '#weight' => 9,
]; ];
$element['alt_field_required'] = [ $element['alt_field_required'] = [
...@@ -433,7 +433,7 @@ protected function defaultImageForm(array &$element, array $settings) { ...@@ -433,7 +433,7 @@ protected function defaultImageForm(array &$element, array $settings) {
$element['default_image']['alt'] = [ $element['default_image']['alt'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Alternative text'), '#title' => t('Alternative text'),
'#description' => t('This text will be used by screen readers, search engines, and when the image cannot be loaded.'), '#description' => t('Short description of the image used by screen readers and displayed when the image is not loaded. This is important for accessibility.'),
'#default_value' => $settings['default_image']['alt'], '#default_value' => $settings['default_image']['alt'],
'#maxlength' => 512, '#maxlength' => 512,
]; ];
......
...@@ -263,7 +263,7 @@ public static function process($element, FormStateInterface $form_state, $form) ...@@ -263,7 +263,7 @@ public static function process($element, FormStateInterface $form_state, $form)
'#title' => t('Alternative text'), '#title' => t('Alternative text'),
'#type' => 'textfield', '#type' => 'textfield',
'#default_value' => isset($item['alt']) ? $item['alt'] : '', '#default_value' => isset($item['alt']) ? $item['alt'] : '',
'#description' => t('This text will be used by screen readers, search engines, or when the image cannot be loaded.'), '#description' => t('Short description of the image used by screen readers and displayed when the image is not loaded. This is important for accessibility.'),
// @see https://www.drupal.org/node/465106#alt-text // @see https://www.drupal.org/node/465106#alt-text
'#maxlength' => 512, '#maxlength' => 512,
'#weight' => -12, '#weight' => -12,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment