Customizable accessible names for the shell menu toggle and the alert close button
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 84/100
- Issue 類型
- 功能
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- handlebars, rust
研究方向
從 sqlpage/templates/shell.handlebars 中兩個選單切換按鈕(第 174 行和第 208 行)以及 alert.handlebars 中可關閉提示框的關閉按鈕開始,並複製 modal 元件為 close_label 已使用的 {{default …}} 模式。在現有元件屬性旁新增兩行文件,然後參照現有渲染測試,新增 tests/sql_test_files/component_rendering/alert_close_label.sql 和 shell_navbar_toggle_label.sql。完成的標準是:新屬性能改變 aria-label,而未設定這些屬性的頁面仍渲染英文預設值。
由索引模型根據 Issue 內容生成。
描述
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 themodalcomponent.
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
languageproperty 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 toshell.handlebarsandalert.handlebarsby 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.
- 主要語言
- Rust
- 星號
- 2.6k
- 分支
- 175
- 平均合併
- 14 小時 16 分鐘
- 30 天內合併 PR
- 43
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
sqlpage/SQLPage 的其他 Issue
-
enhancement
難度 2/5 1-3 小時 新手友好度 65/100
sqlpage/SQLPage#1218 · 3 則留言 ·
維護者通常 1 天內回覆
-
There is no convenient way to reproduce issues可能已有人在做 @81reap 於 26 天前認領。 未關閉enhancement
sqlpage/SQLPage#1566 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Confusing sort interface可能已有人在做 @lovasoa 於 73 天前認領。 未關閉bug
難度 4/5 3-5 天 新手友好度 20/100
sqlpage/SQLPage#1442 · 3 則留言 ·
維護者通常 1 天內回覆
-
Mutation Testing Results :: Dead Code + Missing Tests可能重新可做 @81reap 於 61 天前認領,目前沒有進行中的 PR。 未關閉
sqlpage/SQLPage#1396 · 5 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
chart: 3D charts未關閉enhancement
難度 5/5 一週以上 新手友好度 25/100
維護者通常 1 天內回覆
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 70/100
symposium-dev/symposium#530 ·
維護者通常 5 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
topgrade-rs/topgrade#2540 ·
維護者通常 1 天內回覆
-
Invalid JSON options for ngram and edge_ngram silently use defaults可能已有人在做 @Tilendlesa 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
noemaforge/vimanam#153 ·
維護者通常 1 天內回覆