Add Chinese localization

This commit is contained in:
QiuSW
2026-07-18 17:40:25 +08:00
parent 07c63cb565
commit 2ed513bc25
6 changed files with 465 additions and 465 deletions
+105 -105
View File
@@ -1,142 +1,142 @@
# Windows input and accessibility baseline
# Windows 输入与无障碍基线
## Contents
## 目录
1. Input parity
2. Keyboard and focus
3. Mouse, touch, pen, and drag
4. UI Automation semantics
5. Visual and cognitive accessibility
6. Status, errors, and timing
7. Accessibility test matrix
8. Official sources
1. 输入等价性
2. 键盘与焦点
3. 鼠标、触控、笔与拖拽
4. UI Automation 语义
5. 视觉与认知无障碍
6. 状态、错误与计时
7. 无障碍测试矩阵
8. 官方资料
## 1. Input parity
## 1. 输入等价性
Make every primary scenario possible with keyboard alone. Pointer hover, right-click, touch swipe, pen barrel button, drag-and-drop, and gestures may accelerate a task but must not be the only way to complete it.
确保所有主要场景都能只用键盘完成。指针悬停、右键、触控轻扫、笔桶形按钮、拖放和手势可以加速任务,但不得成为完成任务的唯一方式。
Use standard controls first because they already implement much of the focus, keyboard, pointer, touch, and UI Automation behavior. For every custom control, define:
优先使用标准控件,因为它们已经实现大量焦点、键盘、指针、触控和 UI Automation 行为。为每个自定义控件定义:
- automation role, name, value, state, and supported patterns;
- tab-stop and inner arrow-key behavior;
- keyboard activation and Escape behavior;
- pointer cursor, hover, press, and context menu behavior;
- touch target, manipulation threshold, and gesture alternative;
- focus visuals, selected visuals, and high-contrast rendering.
- 自动化角色、名称、值、状态和支持的模式;
- Tab 停靠点和内部方向键行为;
- 键盘激活和 Escape 行为;
- 指针光标、悬停、按下和上下文菜单行为;
- 触控目标、操作阈值和手势替代方式;
- 焦点视觉、选中视觉和高对比度渲染。
## 2. Keyboard and focus
## 2. 键盘与焦点
- Put actionable elements in the tab sequence; keep labels and decorative elements out.
- Match tab order to visual and reading order. Prefer natural XAML order and use `TabIndex` only to correct a demonstrated issue.
- Use arrow keys inside composite controls such as lists, menus, radio groups, tabs, and grids.
- Set initial focus to the most useful safe element when a window, page, dialog, or task surface opens.
- Return focus to the invoker when a flyout or dialog closes. After deletion, move focus to a predictable adjacent item or stable container.
- Keep the platform focus visual visible. Do not encode focus only through a subtle color change.
- Use access keys for visible commands and form navigation; use keyboard accelerators for frequent or standard actions.
- Show accelerators in menus and tooltips where users learn commands.
- Allow Escape to close dismissible UI or cancel the current transient mode. Do not discard unsaved work silently.
- Ensure Enter and Space activate controls according to standard control behavior; do not invent conflicting key semantics.
- 将可操作元素放入 Tab 顺序;让标签和装饰元素退出该顺序。
- 让 Tab 顺序与视觉和阅读顺序一致。优先使用自然 XAML 顺序,仅在纠正确认存在的问题时使用 `TabIndex`。
- 在列表、菜单、单选组、标签页和网格等复合控件内部使用方向键。
- 窗口、页面、对话框或任务界面打开时,将初始焦点设置到最有用且安全的元素。
- 浮出控件或对话框关闭时将焦点返回调用者。删除后,将焦点移动到可预测的相邻项或稳定容器。
- 保持平台焦点视觉可见。不要只用轻微颜色变化表达焦点。
- 为可见命令和表单导航使用访问键;为频繁或标准操作使用键盘快捷键。
- 在菜单和工具提示中显示快捷键,帮助用户学习命令。
- 允许 Escape 关闭可解除界面或取消当前临时模式。不得静默丢弃未保存工作。
- 确保 Enter 和 Space 按标准控件行为激活控件;不要发明冲突的按键语义。
Use familiar shortcuts only when the command truly has the familiar meaning:
仅当命令真正具有熟悉含义时使用常见快捷键:
| Shortcut | Expected meaning |
| 快捷键 | 预期含义 |
|---|---|
| `Ctrl+N` | new item/document/window as appropriate |
| `Ctrl+O` | open |
| `Ctrl+S` | save |
| `Ctrl+Z` / `Ctrl+Y` or `Ctrl+Shift+Z` | undo / redo, consistent with the app domain |
| `Ctrl+F` | search or find |
| `F5` | refresh when refresh is meaningful |
| `Delete` | delete selected item, with undo or confirmation based on consequence |
| `Alt+Left` | back when the app has navigation history |
| `F6` | move between major panes in complex workspaces |
| `Ctrl+N` | 根据场景新建项目/文档/窗口 |
| `Ctrl+O` | 打开 |
| `Ctrl+S` | 保存 |
| `Ctrl+Z` / `Ctrl+Y` 或 `Ctrl+Shift+Z` | 撤销/重做,并与应用领域保持一致 |
| `Ctrl+F` | 搜索或查找 |
| `F5` | 在刷新有意义时刷新 |
| `Delete` | 删除选中项,并根据后果提供撤销或确认 |
| `Alt+Left` | 应用存在导航历史时后退 |
| `F6` | 在复杂工作区的主要窗格间移动 |
Do not override operating-system or assistive-technology shortcuts.
不要覆盖操作系统或辅助技术快捷键。
## 3. Mouse, touch, pen, and drag
## 3. 鼠标、触控、笔与拖拽
### Mouse and pointer
### 鼠标与指针
- Use hover to preview or accelerate, never to hide the only route to a command.
- Provide a context menu for object-specific commands; expose frequent commands visibly as well.
- Use tooltips for unfamiliar icons, truncated content, and shortcut education—not for essential instructions.
- Keep selection and focus visually distinct in dense lists and grids.
- Preserve target position during hover and press; avoid geometry changes that make the pointer chase a control.
- 使用悬停进行预览或加速,但不要把命令的唯一入口隐藏在悬停中。
- 为对象特定命令提供上下文菜单,同时让频繁命令保持可见。
- 将工具提示用于不熟悉的图标、截断内容和快捷键教学,不要用于关键说明。
- 在高密度列表和网格中,让选择与焦点在视觉上可区分。
- 悬停和按下时保持目标位置稳定;避免几何变化迫使指针追逐控件。
### Touch and pen
### 触控与笔
Use platform controls at their default size where possible. For custom targets, meet the Windows touch baseline:
尽可能使用平台控件的默认尺寸。自定义目标应满足 Windows 触控基线:
- target at least 40 × 40 epx, even if the visible glyph is smaller;
- a 32 epx-tall target can be acceptable when it is at least 120 epx wide;
- for touch-optimized experiences, prefer 44 × 44 epx with at least 4 epx visible separation;
- enlarge frequent or high-consequence targets beyond the minimum;
- do not place destructive targets tightly beside routine actions.
- 目标至少为 40 × 40 epx,即使可见字形更小;
- 高度为 32 epx 的目标,在宽度至少 120 epx 时可以接受;
- 针对触控优化的体验,优先使用 44 × 44 epx,并保持至少 4 epx 可见间距;
- 让频繁使用或误操作后果严重的目标大于最低尺寸;
- 不要让破坏性目标紧邻常规操作。
Support mouse precision without making touch impossible. Make scrolling, zoom, selection, and pen input coexist without gesture conflicts.
在支持鼠标精确操作的同时保证触控可用。让滚动、缩放、选择和笔输入共存且不产生手势冲突。
### Drag and drop
### 拖放
Show a clear drag affordance, valid targets, insertion position, forbidden states, and completion feedback. Use a movement threshold to prevent accidental drags. Always provide keyboard and menu commands such as Move up/down, Move to, Attach, or Import for critical drag operations.
显示清晰的拖动提示、有效目标、插入位置、禁止状态和完成反馈。使用移动阈值避免误拖。对于关键拖动操作,始终提供“上移/下移”“移动到”“附加”或“导入”等键盘和菜单命令。
## 4. UI Automation semantics
## 4. UI Automation 语义
Accessible names must be concise, unique enough in context, and action-oriented for commands.
无障碍名称必须简洁,在上下文中足以区分,并对命令使用操作导向的表述。
- Let standard controls promote visible text when that produces the correct name.
- Set `AutomationProperties.Name` explicitly for icon-only buttons, meaningful images, custom-drawn content, ambiguous repeated controls, or controls whose visible text does not describe the action.
- Associate form labels with fields through `AutomationProperties.LabeledBy` where applicable.
- Put supplemental instructions in help text or accessible descriptions; do not stuff them into the name.
- Expose selection, checked, expanded, pressed, read-only, required, invalid, busy, and disabled states through the correct control or automation peer.
- Mark decorative images and duplicate glyphs so they do not create noise.
- Implement the appropriate UI Automation patterns for custom controls; an accessible name alone is insufficient.
- 当标准控件根据可见文本生成的名称正确时,使用该默认名称。
- 对仅有图标的按钮、有意义的图像、自定义绘制内容、含义不清的重复控件,或可见文本无法描述操作的控件,显式设置 `AutomationProperties.Name`。
- 适用时,通过 `AutomationProperties.LabeledBy` 将表单标签与字段关联。
- 将补充说明放在帮助文本或无障碍描述中;不要把所有内容塞进名称。
- 通过正确的控件或 AutomationPeer 公开选择、选中、展开、按下、只读、必填、无效、忙碌和禁用状态。
- 标记装饰性图像和重复字形,避免产生噪音。
- 为自定义控件实现合适的 UI Automation 模式;只有无障碍名称并不充分。
Do not add an explicit name to every control mechanically. Duplicate or stale names can make the screen-reader experience worse.
不要机械地为每个控件添加显式名称。重复或过期的名称会使屏幕阅读器体验更差。
## 5. Visual and cognitive accessibility
## 5. 视觉与认知无障碍
- Maintain at least 4.5:1 text contrast in the normal light and dark themes.
- Test high contrast; do not use a high-contrast theme as a substitute for adequate normal-theme contrast.
- Pair color with text, shape, icon, position, or pattern for errors, selection, and status.
- Preserve visible focus, current selection, and input validation at all theme states.
- Support Windows text-size settings and display scaling without clipped text, inaccessible controls, or lost commands.
- Prefer wrapping and adaptive height to truncation. Test long localized strings, narrow windows, and right-to-left layout when the product supports such locales.
- Use plain, specific writing. Put the decision or recovery action first; avoid blame and error codes without explanation.
- Avoid flashing and nonessential repetitive animation. Respect system animation preferences and keep interaction possible while motion runs.
- Provide captions or transcripts for meaningful audio/video and text alternatives for informative graphics.
- 在普通浅色和深色主题中保持至少 4.5:1 的文本对比度。
- 测试高对比度;不要把高对比度主题当作普通主题对比度不足的补救方法。
- 对错误、选择和状态,除颜色外同时使用文本、形状、图标、位置或图案。
- 在所有主题状态中保持焦点、当前选择和输入验证清晰可见。
- 支持 Windows 文本大小设置和显示缩放,不能出现文本裁切、控件不可访问或命令丢失。
- 优先使用换行和自适应高度而不是截断。产品支持相关区域时,测试长本地化字符串、窄窗口和从右到左布局。
- 使用平实、具体的文案。先给出决策或恢复操作;避免指责用户,也不要只显示错误代码而不解释。
- 避免闪烁和非必要的重复动画。尊重系统动画偏好,并在动效运行时保持可交互。
- 为有意义的音频/视频提供字幕或文字稿,为信息性图形提供文本替代内容。
## 6. Status, errors, and timing
## 6. 状态、错误与计时
Announce important asynchronous state changes without stealing focus. Use a suitable live-region or standard control behavior for loading completion, errors, and background status.
播报重要的异步状态变化,但不要抢夺焦点。为加载完成、错误和后台状态使用合适的实时区域或标准控件行为。
Error feedback must answer:
错误反馈必须回答:
1. What failed?
2. What user work was preserved?
3. What can the user do now?
1. 什么失败了?
2. 用户的哪些工作已保留?
3. 用户现在可以做什么?
Place field errors near the field and summarize multiple errors at the task level when useful. Move focus only when it helps recovery, such as focusing the first invalid field after submit.
将字段错误放在字段附近;有多个错误时,根据需要在任务层级汇总。仅在有助于恢复时移动焦点,例如提交后聚焦第一个无效字段。
Do not auto-dismiss critical errors. Give users enough time to read transient status, pause time limits when feasible, and provide a persistent history for important background operations or notifications.
不要自动关闭关键错误。给用户足够时间阅读临时状态;可行时暂停时间限制,并为重要后台操作或通知提供持久历史记录。
## 7. Accessibility test matrix
## 7. 无障碍测试矩阵
- [ ] Complete primary flows with keyboard only.
- [ ] Verify logical Tab, Shift+Tab, arrow, Enter, Space, Escape, access-key, and accelerator behavior.
- [ ] Test Narrator reading order, names, roles, values, states, and live announcements.
- [ ] Inspect the UI Automation tree with Accessibility Insights for Windows or Inspect.
- [ ] Test light, dark, and at least one high-contrast theme.
- [ ] Measure text contrast and verify that color is not the only cue.
- [ ] Test Windows text-size changes, display scale changes, Magnifier, and narrow windows.
- [ ] Test mouse, touch when supported, context menus, and alternatives to drag/hover.
- [ ] Check long strings, localization expansion, and any supported right-to-left language.
- [ ] Add automated accessibility checks for critical screens and flows where the test stack supports them.
- [ ] 只使用键盘完成主要流程。
- [ ] 验证合理的 Tab、Shift+Tab、方向键、Enter、Space、Escape、访问键和快捷键行为。
- [ ] 测试 Narrator 阅读顺序、名称、角色、值、状态和实时播报。
- [ ] 使用 Accessibility Insights for Windows 或 Inspect 检查 UI Automation 树。
- [ ] 测试浅色、深色和至少一种高对比度主题。
- [ ] 测量文本对比度,并确认颜色不是唯一提示。
- [ ] 测试 Windows 文本大小变化、显示缩放变化、放大镜和窄窗口。
- [ ] 测试鼠标、支持时的触控、上下文菜单,以及拖拽/悬停的替代方式。
- [ ] 检查长字符串、本地化扩展和任何受支持的从右到左语言。
- [ ] 在测试技术栈支持时,为关键界面和流程添加自动化无障碍检查。
## 8. Official sources
## 8. 官方资料
- [Accessibility checklist for Windows apps](https://learn.microsoft.com/windows/apps/design/accessibility/accessibility-checklist)
- [Keyboard interactions](https://learn.microsoft.com/windows/apps/develop/input/keyboard-interactions)
- [Guidelines for touch targets](https://learn.microsoft.com/windows/apps/develop/input/guidelines-for-targeting)
- [Touch interactions](https://learn.microsoft.com/windows/apps/develop/input/touch-interactions)
- [Accessible text requirements](https://learn.microsoft.com/windows/apps/design/accessibility/accessible-text-requirements)
- [Accessibility testing](https://learn.microsoft.com/windows/apps/design/accessibility/accessibility-testing)
- [Windows 应用无障碍检查清单](https://learn.microsoft.com/windows/apps/design/accessibility/accessibility-checklist)
- [键盘交互](https://learn.microsoft.com/windows/apps/develop/input/keyboard-interactions)
- [触控目标指南](https://learn.microsoft.com/windows/apps/develop/input/guidelines-for-targeting)
- [触控交互](https://learn.microsoft.com/windows/apps/develop/input/touch-interactions)
- [无障碍文本要求](https://learn.microsoft.com/windows/apps/design/accessibility/accessible-text-requirements)
- [无障碍测试](https://learn.microsoft.com/windows/apps/design/accessibility/accessibility-testing)