Give the setup form Chinese text for the ISO's China installs
This commit is contained in:
1 parent
bf08fedf8e
commit
b268838479
2 files changed
+85
-19
No files matched your search
@@ -147,6 +147,16 @@ assert_status "$OMARCHY_FORM_SIGNAL" "region prompt reports Ctrl+C as the caller
|
||||
assert_returned "region prompt survives Ctrl+C under set -e"
|
||||
pass "region prompt propagates Esc and Ctrl+C without dying under set -e"
|
||||
|
||||
OMARCHY_CJK_CONSOLE=1 run_prompt omarchy_prompt_region "0:China 中国"
|
||||
assert_status 0 "region prompt succeeds in a CJK console"
|
||||
[[ $(field region) == "china" ]] || fail "region prompt stores China 中国 as china"
|
||||
[[ $(<"$tmp_dir/stdin.1") == $'Global\nChina 中国' ]] || fail "a CJK console offers the Chinese name"
|
||||
grep -qxF -- 'choose --selected Global --header Select region · 选择区域' "$GUM_ARGS" || fail "a CJK console asks in both languages"
|
||||
OMARCHY_CJK_CONSOLE=1 REGION=china run_prompt omarchy_prompt_region "0:Global"
|
||||
[[ $(field region) == "global" ]] || fail "region prompt stores Global as global in a CJK console"
|
||||
grep -qxF -- 'choose --selected China 中国 --header Select region · 选择区域' "$GUM_ARGS" || fail "a CJK console preselects China by its shown name"
|
||||
pass "a CJK console names China in Chinese and maps it back to china"
|
||||
|
||||
# Keyboard
|
||||
|
||||
run_prompt omarchy_prompt_keyboard "0:German"
|
||||
@@ -233,6 +243,21 @@ assert_status "$OMARCHY_FORM_BACK" "hostname prompt reports Esc as back"
|
||||
assert_returned "hostname prompt survives Esc under set -e"
|
||||
pass "hostname prompt propagates Esc without dying under set -e"
|
||||
|
||||
# Chinese text
|
||||
|
||||
OMARCHY_INSTALL_LANG=zh run_prompt omarchy_prompt_username "0:Bad Name" "0:dhh"
|
||||
assert_status 0 "username prompt succeeds in Chinese"
|
||||
grep -qF -- '--prompt 用户名> ' "$GUM_ARGS" || fail "OMARCHY_INSTALL_LANG=zh asks for the username in Chinese"
|
||||
assert_notices "OMARCHY_INSTALL_LANG=zh explains a bad username in Chinese" "用户名只能用字母和数字,不含空格"
|
||||
run_prompt omarchy_prompt_username "0:dhh"
|
||||
grep -qF -- '--prompt Username> ' "$GUM_ARGS" || fail "the form stays English without OMARCHY_INSTALL_LANG"
|
||||
mapfile -t texts < <(grep -o 'omarchy_text "[^"]*"' "$ROOT/install/provisioning/setup-form.sh" | sed 's/^omarchy_text "//; s/"$//')
|
||||
((${#texts[@]} > 15)) || fail "the form routes its text through omarchy_text"
|
||||
for text in "${texts[@]}"; do
|
||||
[[ -n ${OMARCHY_ZH[$text]:-} ]] || fail "every form text has a Chinese entry" "missing: $text"
|
||||
done
|
||||
pass "OMARCHY_INSTALL_LANG=zh puts every form text in Chinese"
|
||||
|
||||
# Timezone
|
||||
|
||||
TZ_GUESS=Europe/Copenhagen run_prompt omarchy_prompt_timezone "0:Europe/Copenhagen"
|
||||
|
||||
Reference in new issue
Block a user