Skip to content
Snippets Groups Projects
Commit 6e39f483 authored by Alex Pott's avatar Alex Pott Committed by catch
Browse files

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
No related branches found
No related tags found
No related merge requests found
......@@ -141,7 +141,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Editor $e
}
$form['attributes']['alt'] = [
'#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',
'#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).'),
......
......@@ -263,7 +263,7 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
'#type' => 'checkbox',
'#title' => t('Enable <em>Alt</em> 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,
];
$element['alt_field_required'] = [
......@@ -433,7 +433,7 @@ protected function defaultImageForm(array &$element, array $settings) {
$element['default_image']['alt'] = [
'#type' => 'textfield',
'#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'],
'#maxlength' => 512,
];
......
......@@ -263,7 +263,7 @@ public static function process($element, FormStateInterface $form_state, $form)
'#title' => t('Alternative text'),
'#type' => 'textfield',
'#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
'#maxlength' => 512,
'#weight' => -12,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment