Customizable accessible names for the shell menu toggle and the alert close button

Ouverte Adaptée aux débutants
#1,632 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
84/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
handlebars, rust

Piste de recherche

Commencez par sqlpage/templates/shell.handlebars au niveau des deux boutons de bascule du menu (lignes 174 et 208) et par alert.handlebars au niveau du bouton de fermeture de l'alerte amovible, puis copiez le motif {{default …}} déjà utilisé par le composant modal pour close_label. Ajoutez les deux lignes de documentation à côté des propriétés existantes du composant, puis ajoutez tests/sql_test_files/component_rendering/alert_close_label.sql et shell_navbar_toggle_label.sql en vous inspirant des tests de rendu existants. C'est terminé lorsque les nouvelles propriétés modifient le aria-label et que les pages sans elles affichent toujours les valeurs par défaut en anglais.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement

What we are building:

Public-sector web applications in German that have to meet WCAG 2.1 AA (the same applications as in #1612 and #1615).

Our problem:

A few accessible names are still hard-coded in English and have no property, so screen readers announce English words on an otherwise German page:

Component Element Fixed accessible name
shell menu toggle button on small screens (shell.handlebars, lines 174 and 208) "Toggle navigation"
alert close button of a dismissible alert (since #1614) "Close"

Visible texts of these components can already be customized (for example search_placeholder and search_button since #893, link_text on the alert), and the modal component has close_label for its close button. These two names were left out.

What are you currently doing?

We replace the aria-label attributes with JavaScript after the page loads. That works, but it depends on the markup of the templates and has to be re-checked after every SQLPage update.

Describe the solution you'd like

Two optional properties, with the current English text as default:

  • shell: navbar_toggle_label, used for both menu toggle buttons;
  • alert: close_label, the same name as on the modal component.
select 'shell' as component, 'Demo' as title, 'about' as menu_item,
    'Menü öffnen oder schließen' as navbar_toggle_label;
select 'alert' as component, 'Gespeichert' as title, TRUE as dismissible,
    'Schließen' as close_label;

The change is one {{default …}} per attribute, plus two documentation rows. I tried it locally by overriding both templates on v0.48.0: the accessibility tree in Chromium then shows button "Menü öffnen oder schließen" and button "Schließen", and pages without the new properties render exactly as before.

Describe alternatives you've considered

  • Built-in translations selected by the language property of the shell. That would need translation tables inside SQLPage; properties fit better with how #893 handled the other hard-coded strings.
  • Overriding the templates in sqlpage/templates/. That works, but then we have to merge every later change to shell.handlebars and alert.handlebars by hand.

Additional context

There are a few more fixed English texts that could follow the same pattern later, if wanted: the close button of the toast component ("Close notification"), and the title tooltips "Edit", "Delete" and "View" of the action icons in table and list. I left them out to keep this request small.

If wanted, I can provide a pull request with both properties, their documentation, a CHANGELOG entry and two rendering tests in tests/sql_test_files/component_rendering/ (alert_close_label.sql, shell_navbar_toggle_label.sql), which fail on v0.48.0 and pass with the change.

Langage dominant
Rust
Étoiles
2.6k
Forks
175
Merge moyen
14 h 16 min
PR mergées (30 j)
43

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de sqlpage/SQLPage

Toutes les issues de sqlpage/SQLPage

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.