summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2018-09-09 16:15:50 (GMT)
committerNathaniel Catchpole2018-09-10 09:31:25 (GMT)
commit6e39f483f90f4f1e84521a5dfa58e22ab8c7cea2 (patch)
treea6ad990aecc32c620b5e58dfa6d73c765aa8d52c
parent12737b3ce92c64c665d373b44d6a316d933f3f46 (diff)
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 36ff61a766fa394714170168f82dcf0c0c40c8e9)
-rw-r--r--core/modules/editor/src/Form/EditorImageDialog.php2
-rw-r--r--core/modules/image/src/Plugin/Field/FieldType/ImageItem.php4
-rw-r--r--core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php2
3 files changed, 4 insertions, 4 deletions
diff --git a/core/modules/editor/src/Form/EditorImageDialog.php b/core/modules/editor/src/Form/EditorImageDialog.php
index 0e148d2..0de74e5 100644
--- a/core/modules/editor/src/Form/EditorImageDialog.php
+++ b/core/modules/editor/src/Form/EditorImageDialog.php
@@ -141,7 +141,7 @@ class EditorImageDialog extends FormBase {
}
$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).'),
diff --git a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
index 67a15a7..b3aa0c9 100644
--- a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
+++ b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
@@ -263,7 +263,7 @@ class ImageItem extends FileItem {
'#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 @@ class ImageItem extends FileItem {
$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,
];
diff --git a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
index 16160b2..d7556b4 100644
--- a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
+++ b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
@@ -263,7 +263,7 @@ class ImageWidget extends FileWidget {
'#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,