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 天内回复