From bda7c8d8bf5936a56c66240e1ea0373a3b769809 Mon Sep 17 00:00:00 2001 From: Stout Ni Date: Tue, 26 Mar 2024 00:42:43 +0800 Subject: [PATCH] feat(i18n): Add Simplified Chinese translation (#4379) ## Changes: - Added `zh_CN.json` for Simplified Chinese translation. - Modified some minor issues in README.md: - Fixed the issue that the path docs/check-message-template.md was not found. - Updated the supported languages (added Greek, Italian, Simplified Chinese and Traditional Chinese). --------- Co-authored-by: dequejosie <83524297+dequejosie@users.noreply.github.com> --- README.md | 6 +- locales/zh_CN.json | 1116 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1121 insertions(+), 1 deletion(-) create mode 100644 locales/zh_CN.json diff --git a/README.md b/README.md index f27a6ef381..1f6ccfec47 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ or equivalently: This will create a new build for axe, called `axe..js` and `axe..min.js`. If you want to build all localized versions, simply pass in `--all-lang` instead. If you want to build multiple localized versions (but not all of them), you can pass in a comma-separated list of languages to the `--lang` flag, like `--lang=nl,ja`. -To create a new translation for axe, start by running `grunt translate --lang=`. This will create a json file fin the `./locales` directory, with the default English text in it for you to translate. Alternatively, you could copy `./locales/_template.json`. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below. For details on the message syntax, see [Check Message Template](/docs/check-message-template.md). +To create a new translation for axe, start by running `grunt translate --lang=`. This will create a json file fin the `./locales` directory, with the default English text in it for you to translate. Alternatively, you could copy `./locales/_template.json`. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below. For details on the message syntax, see [Check Message Template](/doc/check-message-template.md). To update existing translation file, re-run `grunt translate --lang=`. This will add new messages used in English and remove messages which were not used in English. @@ -149,6 +149,10 @@ Axe-core supports the following locales. Do note that since locales are contribu - Polish - Portuguese (Brazilian) - Spanish +- Greek +- Italian +- Simplified Chinese +- Traditional Chinese ## Updates & Security diff --git a/locales/zh_CN.json b/locales/zh_CN.json new file mode 100644 index 0000000000..ef5e6876dc --- /dev/null +++ b/locales/zh_CN.json @@ -0,0 +1,1116 @@ +{ + "lang": "zh_CN", + "rules": { + "accesskeys": { + "description": "确保每个 accesskey 属性值都是唯一的", + "help": "accesskey 属性值应当唯一" + }, + "area-alt": { + "description": "确保图像映射中的 元素有替代文本", + "help": " 元素必须有替代文本" + }, + "aria-allowed-attr": { + "description": "确保元素的角色支持其 ARIA 属性", + "help": "元素仅能使用受支持的 ARIA 属性" + }, + "aria-allowed-role": { + "description": "确保 role 属性值符合所属元素", + "help": "ARIA 角色应该符合元素" + }, + "aria-braille-equivalent": { + "description": "确保 aria-braillelabel 和 aria-brailleroledescription 有对应的非盲文的标签和描述", + "help": "aria-braille 相关属性必须有非盲文的对应属性" + }, + "aria-command-name": { + "description": "确保每个 ARIA 按钮、链接和菜单项都有可访问名称", + "help": "ARIA 指令必须有一个可访问名称" + }, + "aria-conditional-attr": { + "description": "确保 ARIA 属性的使用符合所属元素角色的特定规范", + "help": "ARIA 属性的使用必须符合元素的特定角色" + }, + "aria-deprecated-role": { + "description": "确保页面元素不使用已弃用的角色", + "help": "不得使用已弃用的 ARIA 角色" + }, + "aria-dialog-name": { + "description": "确保每个 ARIA 对话框和警示框节点都有可访问的名称", + "help": "ARIA 对话框和警示框节点应当有可访问的名称" + }, + "aria-hidden-body": { + "description": "确保 不存在 aria-hidden=\"true\"", + "help": " 上不得存在 aria-hidden=\"true\"" + }, + "aria-hidden-focus": { + "description": "确保设置为 ARIA 隐藏的元素不可聚焦,且不包含可聚焦的元素", + "help": "被设定为 ARIA 隐藏的元素不可聚焦,且不包含可聚焦的元素" + }, + "aria-input-field-name": { + "description": "确保每个 ARIA 输入字段都有可访问的名称", + "help": "ARIA 输入字段必须有可访问的名称" + }, + "aria-meter-name": { + "description": "确保每个 ARIA 计量器节点都有可访问的名称", + "help": "ARIA 计量器节点必须有可访问的名称" + }, + "aria-progressbar-name": { + "description": "确保每个 ARIA 进度条节点都有可访问的名称", + "help": "ARIA 进度条节点必须有可访问的名称" + }, + "aria-prohibited-attr": { + "description": "确保 ARIA 属性没有被禁止用于某元素的角色", + "help": "元素只能使用允许的 ARIA 属性" + }, + "aria-required-attr": { + "description": "确保拥有 ARIA 角色的元素包含了所有必需的 ARIA 属性", + "help": "必须提供必需的 ARIA 属性" + }, + "aria-required-children": { + "description": "如果元素的ARIA角色需要子角色,确保该元素包含这些子元素", + "help": "某些 ARIA 角色必须包含特定的子元素" + }, + "aria-required-parent": { + "description": "如果元素的ARIA角色需要父角色,确保该元素被这些父元素包含", + "help": "某些 ARIA 角色必须被特定的父元素包含" + }, + "aria-roledescription": { + "description": "确保 aria-roledescription 仅用于有隐式或显式角色的元素", + "help": "aria-roledescription 必须用于有语义角色的元素" + }, + "aria-roles": { + "description": "确保所有元素包含的 role 属性值都是有效的", + "help": "使用的 ARIA 角色属性值必须有效" + }, + "aria-text": { + "description": "确保使用 role=\"text\" 的元素没有任何可聚焦后代", + "help": "\"role=text\" 应该没有任何可聚焦的后代" + }, + "aria-toggle-field-name": { + "description": "确保每个 ARIA 切换字段都有可访问的名称", + "help": "ARIA 切换字段必须有可访问名称" + }, + "aria-tooltip-name": { + "description": "确保每个 ARIA 工具提示节点都有一个可访问名称", + "help": "ARIA 工具提示节点必须有一个可访问名称" + }, + "aria-treeitem-name": { + "description": "确保每个 ARIA 树项目节点都有一个可访问名称", + "help": "ARIA 树项目节点应有一个可访问名称" + }, + "aria-valid-attr-value": { + "description": "确保所有 ARIA 属性值都是有效的", + "help": "ARIA 属性值必须有效" + }, + "aria-valid-attr": { + "description": "确保以 aria- 开头的属性是有效的 ARIA 属性", + "help": "ARIA 属性名称必须有效" + }, + "audio-caption": { + "description": "确保