Skip to content

Add a Setup > Region toggle with Chinese sources, language and input method - #9548

Open
ZacharyZhang-NY wants to merge 1 commit into
omacom:quattrofrom
ZacharyZhang-NY:china-region
Open

Add a Setup > Region toggle with Chinese sources, language and input method#9548
ZacharyZhang-NY wants to merge 1 commit into
omacom:quattrofrom
ZacharyZhang-NY:china-region

Conversation

@ZacharyZhang-NY

@ZacharyZhang-NY ZacharyZhang-NY commented Sep 1, 2026

Copy link
Copy Markdown

Summary

Replaces #9519, after a round of VM testing.

Setup > Region toggles between World and China. China points npm, pip, cargo, go and gem at Chinese mirrors, switches the system language to zh_CN, installs @manateelazycat's rime-ice-installer and runs it, makes Rime the active input method with Ctrl+Space as the toggle, and swaps the menu to Chinese labels through the stock user-extension overlay. World puts all of it back and leaves the input method installed.

Every target is checked before anything is written: a registry, locale, or menu extension someone set by hand refuses the whole switch, and World only removes values Omarchy wrote. File permissions survive the rewrites.

The overlay flushed out a real bug: mergeMenuSources never implemented the field-level override that docs/menu.md documents, so a label-only extension entry wiped the row's action and provider and the row disappeared. Fixed, with regression tests.

Companion: omacom/omarchy-pkgs#251 adds rime-ice-installer to the package repo so omarchy-pkg-add can find it.

Test plan

  • region-test.sh (new, 15 cases): apply, restore, and refusals for all five sources, .npmrc keeps its 0600 mode, locale/fcitx5/menu-overlay round-trips through mocks
  • menu-test.sh: Region entries, overlay validation, merge-override regressions; menu-guards-test.sh covers the new guard reader
  • ./test/all matches the clean-tree baseline
  • Fresh VM install: China gives Chinese sources, language, menu, and Rime with Ctrl+Space; World returns to stock

…method

`omarchy region china` points npm, pip, cargo, go and gem at fast Chinese
mirrors, switches the system language to zh_CN (generated on demand, live from
the next login) and sets up the Rime Ice Chinese input method through Andy
Stewart's rime-ice-installer (AUR) — syncing the repo databases first, since a
fresh install has none until its first update — whose TUI drives its own sudo
and fcitx5 restart on the plumbing Omarchy already ships, then makes Rime the
active default with Ctrl+Space pinned as the toggle, and dresses the Omarchy
menu in Chinese labels through the stock user-extension overlay; `omarchy region world` takes
the source overrides back out, returns the language to en_US and the menu
extension to its shipped sample only when they are what Omarchy set, and
leaves the input method alone. Every target is
checked before anything is touched — a value someone else configured refuses
the whole switch rather than being overwritten, restores remove exactly the
values Omarchy wrote, and file permissions survive the rewrite. The Arch and
Omarchy mirrors themselves wait on the Chinese mirror infrastructure, and
omarchy-region joins the menu's guard readers since two rows read it. The
overlay also surfaced that mergeMenuSources never implemented the documented
field-level override — a label-only user entry clobbered actions and
providers with defaults, hiding those rows — so the merge now applies only
the fields a file declares.

Co-authored-by: Andy Stewart <lazycat.manatee@gmail.com>
"style.bar.position": {"label":"位置"},
"style.bar.transparency": {"label":"透明"},
"style.screensaver": {"label":"屏保"},
"style.about": {"label":"关于页"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here should "关于"

"update.password": {"label":"密码"},
"update.timezone": {"label":"时区"},
"update.time": {"label":"时间"},
"update.channel.stable": {"label":"稳定 Stable"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here just keep Stable be ok.

"setup.security.passwordless-sudo": {"label":"免密 sudo"},
"setup.security.sudoless-docker": {"label":"免 sudo Docker"},
"setup.direct-boot": {"label":"直接启动"},
"setup.reset": {"label":"恢复出厂"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"恢复出厂设置"

"trigger.capture.screenshot": {"label":"截图"},
"trigger.capture.screenrecord.stop": {"label":"停止录屏"},
"trigger.capture.screenrecord": {"label":"录屏"},
"trigger.capture.text": {"label":"取字 OCR"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"OCR 取字"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants