cn_links=( "environment.conf /etc/environment.d/90-omarchy-china.conf" "cargo.toml /.cargo/config.toml" "gemrc /etc/gemrc" ) # The installer writes the marker; omarchy-region passes the region it switches to. region=global if [[ -e /etc/omarchy/region ]]; then region=$(&2 exit 1 fi done mkdir -p /etc/omarchy echo cn >/etc/omarchy/region for link in "${cn_links[@]}"; do read -r source target <<<"$link" mkdir -p "${target%/*}" ln -sfn "$OMARCHY_PATH/default/regions/cn/$source" "$target" done sed -i 's/^#\(zh_CN\.UTF-8 UTF-8\)/\1/' /etc/locale.gen locale-gen if grep -q '^LANG=' /etc/locale.conf; then sed -i 's/^LANG=.*/LANG=zh_CN.UTF-8/' /etc/locale.conf else echo LANG=zh_CN.UTF-8 >>/etc/locale.conf fi ;; *) echo "Unknown region: $region" >&2 exit 1 ;; esac