Files
omarchy/test/shell.d/typing-setup-test.sh
T
ZacharyZhang-NY a9b39710a2 Add Simplified Chinese as a system language
The installer asks for the language before the keyboard, and
Setup > Language (omarchy language en|zh) switches it later. Under
zh_CN the menu reads its labels from omarchy-menu.zh-cn.jsonc, the
shell from I18nZh.js through I18n.tr, and notifications are worded
by their sender through omarchy-text, which reads the same table.
User text is never translated.
2026-10-12 02:56:40 -04:00

21 lines
1.5 KiB
Bash

#!/bin/bash
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"
PATH="$ROOT/bin:$PATH" OMARCHY_PATH="$ROOT" python "$ROOT/test/shell.d/typing-setup-checks.py"
zh=$(cd "$ROOT/default/input-methods" && PATH="$ROOT/bin:$PATH" OMARCHY_PATH="$ROOT" LANG=zh_CN.UTF-8 python -c 'import typing_setup; print(typing_setup.text("Install %1 to use %2", "fcitx5-mozc", "Mozc"))')
[[ $zh == "安装 fcitx5-mozc 后才能使用 Mozc" ]] || fail "a Chinese session words the input setup errors in Chinese" "$zh"
pass "a Chinese session words the input setup errors in Chinese"
run_node_test <<'JS'
const menu = requireFromRoot('shell/plugins/menu/MenuModel.js')
const options = ['French', '\tJapanese (Mozc)', 'x\tSame label\tfirst', 'x\tSame label\tsecond']
assertEqual(menu.dmenuValue(options[2]), 'Same label\tfirst', 'multi-select keeps a stable subtext value without the icon')
assertDeepEqual(menu.dmenuSelections(options, ['Same label\tsecond', 'French', 'stale']), ['French', 'Same label\tsecond'], 'multi-select preserves option order and excludes stale choices')
assertDeepEqual(menu.dmenuSelections(options, ['Same label\tsecond', 'French', 'stale'], true), ['Same label\tsecond', 'French'], 'immediate selections preserve switching order')
assertDeepEqual(menu.toggleDmenuSelection(['French'], 'French'), [], 'deselecting the final option produces an empty selection')
assertDeepEqual(menu.toggleDmenuSelection(['French'], 'Japanese (Mozc)'), ['French', 'Japanese (Mozc)'], 'selecting an input retains earlier choices')
JS