Skip to content

Commit

Permalink
chore(i18n): add htmlcs_zh_TW translations and prep ar locale
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Feb 23, 2024
1 parent dd0f19a commit 5101ba8
Show file tree
Hide file tree
Showing 7 changed files with 1,519 additions and 5 deletions.
1,043 changes: 1,043 additions & 0 deletions fast_axecore/locales/ar.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion fast_axecore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"cp:build": "echo 'building fast_axecore'",
"tsc": "yarn compile:build && tsc && cp ./lib/intro.stub dist && cp ./lib/outro.stub dist",
"develop": "grunt dev --force",
"build": "(rm -f -r ./dist/*) 2>/dev/null && yarn tsc && grunt --lang=en,da,de,es,eu,pl,fr,he,ja,ko,nl,no_NB,pt_BR",
"build": "(rm -f -r ./dist/*) 2>/dev/null && yarn tsc && grunt --lang=en,ar,da,de,es,eu,pl,fr,he,ja,ko,nl,no_NB,pt_BR,zh_CN",
"build:fast_axecore": "yarn build",
"eslint": "eslint --color --format stylish '{lib,test,build,doc}/**/*.js' 'Gruntfile.js'",
"version": "echo \"use 'npm run release' to bump axe-core version\" && exit 1",
Expand Down
461 changes: 461 additions & 0 deletions fast_htmlcs/Translations/ar.ts

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions fast_htmlcs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
],
"scripts": {
"cp:build": "echo 'building fast_htmlcs'",
"build:all": "yarn cp:build && tsc && grunt build --lang=en,fr,es,it,ja,nl,pl,zh_CN,zh_TW",
"prepack": "tsc && grunt build --lang=en,fr,es,it,ja,nl,pl,zh_CN,zh_TW && yarn swc:dist",
"build:all": "yarn cp:build && tsc && yarn build:locales",
"prepack": "tsc && yarn build:locales && yarn swc:dist",
"build": "yarn build:all && yarn swc:dist",
"build:locales": "grunt build --lang=en,ar,fr,es,it,ja,nl,pl,zh_CN,zh_TW",
"swc:dist": "npx swc --copy-files --config-file .swcrc ./build -d ./build",
"test": "grunt eslint",
"fix": "prettier --write '**/*.{ts,tsx}'",
Expand Down
9 changes: 8 additions & 1 deletion kayle/lib/runner-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,18 @@ const runnersJavascript = {
kayle: readFileSync(`${__dirname}/runner.js`, "utf-8"),
// htmlcs scripts in all locales
htmlcs: loadRunnerScript("htmlcs", ""),
htmlcs_ar: loadRunnerScript("htmlcs", "ar"),
htmlcs_es: loadRunnerScript("htmlcs", "es"),
htmlcs_ja: loadRunnerScript("htmlcs", "ja"),
htmlcs_fr: loadRunnerScript("htmlcs", "fr"),
htmlcs_it: loadRunnerScript("htmlcs", "it"),
htmlcs_nl: loadRunnerScript("htmlcs", "nl"),
htmlcs_pl: loadRunnerScript("htmlcs", "pl"),
htmlcs_zh_CN: loadRunnerScript("htmlcs", "zh-CN"),
// htmlcs_zh_TN: loadRunnerScript("htmlcs", "zh-TN"),
htmlcs_zh_TW: loadRunnerScript("htmlcs", "zh-TW"),
// axe scripts in all locales
axe: loadRunnerScript("axe", "en"),
axe_ar: loadRunnerScript("axe", "ar"),
axe_es: loadRunnerScript("axe", "es"),
axe_ja: loadRunnerScript("axe", "ja"),
axe_fr: loadRunnerScript("axe", "fr"),
Expand All @@ -50,6 +52,8 @@ const runnersJavascript = {
axe_nl: loadRunnerScript("axe", "nl"),
axe_pl: loadRunnerScript("axe", "pl"),
axe_ko: loadRunnerScript("axe", "ko"),
axe_zh_CN: loadRunnerScript("axe", "zh-CN"),
// axe_zh_TW: loadRunnerScript("axe", "zh-TW"),
// axe_no_NB: loadRunnerScript("axe", "no-NB"),
// axe_pt_BR: loadRunnerScript("axe", "pt-BR"),
};
Expand Down Expand Up @@ -89,13 +93,16 @@ const getRunner = (

export type Runner = Exclude<
keyof typeof runnersJavascript,
| "htmlcs_ar"
| "htmlcs_es"
| "htmlcs_ja"
| "htmlcs_fr"
| "htmlcs_it"
| "htmlcs_nl"
| "htmlcs_pl"
| "htmlcs_zh_CN"
| "htmlcs_zh_TW"
| "axe_ar"
| "axe_es"
| "axe_ja"
| "axe_fr"
Expand Down
2 changes: 2 additions & 0 deletions kayle/lib/runners/axe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ const axeRunner = {

// hard code locales to the list to axe-core/locales - not likely to update often
const locales = [
"ar",
"da",
"de",
"es",
Expand All @@ -138,6 +139,7 @@ const locales = [
"pl",
"no_NB",
"pt_BR",
"zh_CN"
];

for (const lang of locales) {
Expand Down
2 changes: 1 addition & 1 deletion kayle/lib/runners/htmlcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const htmlcsRunner = {
};

// hard code locales to the list to htmlcs locales not EN
const locales = ["fr", "es", "it", "ja", "nl", "pl", "zh_CN", "zh_TW"];
const locales = ["ar", "fr", "es", "it", "ja", "nl", "pl", "zh_CN", "zh_TW"];

for (const lang of locales) {
htmlcsRunner[lang.replace("_", "-")] = {
Expand Down

0 comments on commit 5101ba8

Please sign in to comment.