'Show template details' button label and text mismatch when the 'Show button text labels' setting is enabled #42371
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Type] Bug
An existing feature does not function as intended
Description
Similar to #42236 but with an additional issue about translations.
In the Site Editor, when the preference 'Show button text labels' is enabled, the Show template details button shows text instead of the chevron icon:
The visible text 'Details' is different from the actual accessible name provided by the button aria-label, which is 'Show template details' or 'Show template part details'.
One of the main reasons why the 'Show button text labels' preference was implemented is to help speech recognition software users to use the Editor.
These users need to actually see a control name to be able to voice a command with their speech recognition software. For this to work, the visible text of a control must match (or at least start with) the actual accessible name. See also:
WCAG Success Criterion 2.5.3 Label in Name
https://www.w3.org/TR/WCAG21/#label-in-name
Additionally, part of the aria-label string is not translatable. The
DocumentActions
gets anentityLabel
prop with hardcoded non-translatable English stringstemplate
ortemplate part
:gutenberg/packages/edit-site/src/components/header/index.js
Lines 179 to 188 in 8489bc7
These strings are used for the Show details button label, to replace the placeholder in a translation function:
__( 'Show %s details' )
The resulting string is a mix of translatable and non-translatable words. Instead, a fully translatable string should be provided to translators.
Note: the non-translatable strings are used also for the visually hidden H1 heading on this page. That should be fixed as well.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: