diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 4fb0285ae..f74ed5b4d 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -12,7 +12,7 @@ }, "lang1": { "message": "" }, "i18n": { "message": "" }, - "i18nAll": { "message": "zh fr" }, + "i18nAll": { "message": "zh fr zh-TW" }, "noActiveState": { "message": "As configured, here's no active state" }, "vblank": { "message": "" }, "voptions": { "message": "" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index ce4d2f175..3a88a0eca 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -10,7 +10,7 @@ "description": { "message": "一款支持全鍵盤操作瀏覽器的輔助工具,只用鍵盤即可點擊任意連結、切換分頁和快速搜索任意內容,支持自訂快速鍵和調整操作細節" }, - "lang1": { "message": "zh_TW" }, + "lang1": { "message": "zh" }, "noActiveState": { "message": "已設定不顯示工作狀態" }, "vblank": { "message": "空白頁" }, "voptions": { "message": "設定" }, diff --git a/background/i18n.ts b/background/i18n.ts index 87a8d44ec..f66dcec60 100644 --- a/background/i18n.ts +++ b/background/i18n.ts @@ -57,7 +57,8 @@ const loadExt_ = (): Promise => { ]).then(([enDict, wanted]): Promise | RawExtDict[] => { let all = ((enDict.get("i18nAll") || {}).message || "").split(" "), i = "" for (i of wanted || []) { - i = all.includes(i) || all.includes(i = i.split("-")[0]) ? i : "" + all.includes(i) || all.includes(i = i.split("-")[0]) || (i = "") + if (i) { break } } if (!i) { return [enDict] } return Promise.all([enDict, fetchFile_(`/_locales/${i}/messages.json`)]) diff --git a/gulpfile.js b/gulpfile.js index 4f0096d6d..8d280e79b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -72,7 +72,7 @@ var Tasks = { "static/json": function() { const path = ["_locales/*/messages.json", "settings-template.json", "i18n/**/*.json", "!" + LOCALES_EN] if (getBuildItem("BTypes") === BrowserType.Firefox) { - path.push("!_locales/*_*/**") + path.push("!_locales/zh_CN/**") } if (!getBuildItem("NDEBUG")) { return copyByPath(path); diff --git a/scripts/firefox2.sh b/scripts/firefox2.sh index e97398a5f..787411286 100644 --- a/scripts/firefox2.sh +++ b/scripts/firefox2.sh @@ -227,7 +227,7 @@ if test -z "$DIST" && test -f "${VC_EXT}"/manifest.json && ! test -f "${VC_EXT}" fi if test ${DIST:-0} -gt 0; then VC_EXT=$(/usr/bin/realpath "${VC_EXT}") - rm -rf "${VC_EXT}"/_locales/*_* + rm -rf "${VC_EXT}"/_locales/zh_CN wp vc_ext_w "$VC_EXT" if ! test -f ${VC_EXT}/manifest.json; then echo -e "No dist extension: "$vc_ext_w >&2 diff --git a/scripts/make.sh b/scripts/make.sh index 36c274755..9151167af 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -65,7 +65,7 @@ output=$1 ori_output=$output test_working=${TEST_WORKING:-1} # 0: may be; 1: is Chromium; 2: is Firefox -chrome_only=${BUILD_BTypes:-0} +btypes=${BUILD_BTypes:-0} test "$manifest_version" == "2" && mv2_tail="-mv2" || mv2_tail= if [ -z "$output" -o -d "$output" ]; then output=${output%/} @@ -78,13 +78,13 @@ if [ -z "$output" -o -d "$output" ]; then ver=${ver}-debug elif test "$BUILD_EdgeC" == 1; then ver=${ver}-edge - chrome_only=1 + btypes=1 elif test -f "$ZIP_BASE/.build/.chrome.build"; then ver=${ver}-chrome - chrome_only=1 + btypes=1 elif test -f "$ZIP_BASE/.build/.firefox.build"; then ver=${ver}-firefox - chrome_only=2 + btypes=2 else ver=${ver}-dist fi @@ -146,9 +146,9 @@ fi if ! bool "$WITH_MAP"; then ZIP_IGNORE=$ZIP_IGNORE' *.map' fi -if test $chrome_only = 2; then - ZIP_IGNORE=$ZIP_IGNORE' *.bin _locales/*_*' -elif test $chrome_only = 1; then +if test $btypes == 2; then + ZIP_IGNORE=$ZIP_IGNORE' *.bin _locales/zh_CN' +elif test $btypes == 1; then ZIP_IGNORE=$ZIP_IGNORE' icons/disable*.png icons/partial*.png' fi if ! bool "$INCLUDE_ALL_DOCS"; then