diff --git a/AGENTS.md b/AGENTS.md index 9dff669f..fdfc350c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -103,7 +103,7 @@ Exceptions are allowed for migration and package-helper scripts where the helper - `default/region/china/pacman.sed` puts a `.omarchy.cn` twin ahead of every `.omarchy.org` server; `omarchy-refresh-pacman`, `install/post-install/pacman.sh` and `omarchy-region` apply it. Nothing in `omarchy update` or migrations may change the region or `/etc/locale.conf`, and a migration that edits an `.omarchy.org` `Server` line must edit its `.cn` twin the same way. - China-only menu rows carry `"when":"[[ \"$(omarchy-region)\" == \"China\" ]]"` on every row, not only the submenu, because search checks each row's own guard. - Chinese menu labels live in `default/omarchy/omarchy-menu.zh-cn.jsonc`, merged when `LANG` starts with `zh_CN`; give a new menu row with translatable words a label there. -- Shell text goes through `I18n.tr("English %1", arg)` from `qs.Commons`, with its Chinese in `shell/Commons/I18nZh.js` keyed by the English. The shell translates fixed notification and OSD text by exact match; a sender whose message carries a name or number words it with `omarchy-text "English %1" "$arg"` (Python: `text()`), which reads the same table. `test/shell.d/shell-i18n-test.sh` fails on a missing entry. +- Shell text goes through `I18n.tr("English %1", arg)` from `qs.Commons`, with its Chinese in `shell/Commons/I18nZh.js` keyed by the English. Notifications and OSD messages are worded by their sender with `omarchy-text "English %1" "$arg"` (Python: `text()`, QML: `I18n.tr`), which reads the same table; the shell shows them as given, so user text is never translated. `test/shell.d/shell-i18n-test.sh` fails on a missing entry. - `rime-ice-installer` is built from `omarchy-pkgs` with `omarchy-offline.patch` until it ships in the Omarchy repo. # Config Structure diff --git a/bin/omarchy-audio-input-mute b/bin/omarchy-audio-input-mute index 554eae44..8eb2189f 100755 --- a/bin/omarchy-audio-input-mute +++ b/bin/omarchy-audio-input-mute @@ -6,8 +6,8 @@ wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle >/dev/null if wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep -q MUTED; then omarchy-brightness-keyboard-mute on - omarchy-osd -i microphone-muted -m "Microphone muted" + omarchy-osd -i microphone-muted -m "$(omarchy-text "Microphone muted")" else omarchy-brightness-keyboard-mute off - omarchy-osd -i microphone -m "Microphone on" + omarchy-osd -i microphone -m "$(omarchy-text "Microphone on")" fi diff --git a/bin/omarchy-audio-output-switch b/bin/omarchy-audio-output-switch index 11d2a356..a1faf24d 100755 --- a/bin/omarchy-audio-output-switch +++ b/bin/omarchy-audio-output-switch @@ -13,7 +13,7 @@ sinks=$(timeout 2 pactl -f json list sinks | sinks_count=$(jq 'length' <<<"$sinks") if (( sinks_count == 0 )); then - omarchy-osd -m "No audio devices found" + omarchy-osd -m "$(omarchy-text "No audio devices found")" exit 1 fi diff --git a/bin/omarchy-battery-low b/bin/omarchy-battery-low index e45eac84..23ab7ff0 100755 --- a/bin/omarchy-battery-low +++ b/bin/omarchy-battery-low @@ -13,5 +13,5 @@ fi level=$1 -omarchy-notification-send -g 󱐋 -u critical "Time to recharge!" "$(omarchy-text "Battery is down to %1%" "$level")" -i battery-caution -t 30000 +omarchy-notification-send -g 󱐋 -u critical "$(omarchy-text "Time to recharge!")" "$(omarchy-text "Battery is down to %1%" "$level")" -i battery-caution -t 30000 omarchy-hook battery-low "$level" diff --git a/bin/omarchy-capture-qr b/bin/omarchy-capture-qr index 17897387..26affebe 100755 --- a/bin/omarchy-capture-qr +++ b/bin/omarchy-capture-qr @@ -23,7 +23,7 @@ SELECTION=$(slurp 2>/dev/null) RESULT=$(grim -g "$SELECTION" - | zbarimg -q --raw -Sdisable -Sqrcode.enable - 2>/dev/null) if [[ -z $RESULT ]]; then - omarchy-notification-send -g 󰐲 -u critical "No QR code found" "Select a region containing a QR code" + omarchy-notification-send -g 󰐲 -u critical "$(omarchy-text "No QR code found")" "$(omarchy-text "Select a region containing a QR code")" exit 1 fi @@ -33,4 +33,4 @@ fi # the notification history, and an unmarked copy would be retained by clipboard # history. Pasting still works; only the recorded copy is given up. printf '%s' "$RESULT" | wl-copy --sensitive -omarchy-notification-send -g 󰐲 "QR code copied to clipboard" +omarchy-notification-send -g 󰐲 "$(omarchy-text "QR code copied to clipboard")" diff --git a/bin/omarchy-capture-screenrecording b/bin/omarchy-capture-screenrecording index 3d4f5b22..8779637e 100755 --- a/bin/omarchy-capture-screenrecording +++ b/bin/omarchy-capture-screenrecording @@ -76,7 +76,7 @@ start_webcam_overlay() { if [[ -z $WEBCAM_DEVICE ]]; then WEBCAM_DEVICE=$(omarchy-capture-webcam-list | sed -n '1s/[[:space:]].*//p') if [[ -z $WEBCAM_DEVICE ]]; then - omarchy-notification-send -u critical -t 3000 "No webcam devices found" + omarchy-notification-send -u critical -t 3000 "$(omarchy-text "No webcam devices found")" return 1 fi fi @@ -231,7 +231,7 @@ stop_screenrecording() { if pgrep -f "^gpu-screen-recorder" >/dev/null; then pkill -9 -f "^gpu-screen-recorder" - omarchy-notification-send -u critical -t 5000 "Screen recording error" "Recording process had to be force-killed. Video may be corrupted." + omarchy-notification-send -u critical -t 5000 "$(omarchy-text "Screen recording error")" "$(omarchy-text "Recording process had to be force-killed. Video may be corrupted.")" else finalize_recording local filename=$(cat "$RECORDING_FILE" 2>/dev/null) @@ -241,7 +241,7 @@ stop_screenrecording() { # Generate a preview thumbnail from the first frame ffmpeg -y -i "$filename" -ss 00:00:00.1 -vframes 1 -q:v 2 "$preview" -loglevel quiet 2>/dev/null - omarchy-notification-send "Screen recording saved" "Open with Super + Alt + , (or click this)" \ + omarchy-notification-send "$(omarchy-text "Screen recording saved")" "$(omarchy-text "Open with Super + Alt + , (or click this)")" \ -t 10000 --image "${preview:-$filename}" \ --exec mpv -- "$filename" diff --git a/bin/omarchy-capture-screenrecording-with-webcam b/bin/omarchy-capture-screenrecording-with-webcam index e5b91bfd..f99a0514 100755 --- a/bin/omarchy-capture-screenrecording-with-webcam +++ b/bin/omarchy-capture-screenrecording-with-webcam @@ -5,7 +5,7 @@ mapfile -t devices < <(omarchy-capture-webcam-list) if (( ${#devices[@]} == 0 )); then - omarchy-notification-send "No webcam devices found" -u critical -t 3000 + omarchy-notification-send "$(omarchy-text "No webcam devices found")" -u critical -t 3000 exit 1 fi diff --git a/bin/omarchy-capture-text b/bin/omarchy-capture-text index 84260c4e..1c430f8e 100755 --- a/bin/omarchy-capture-text +++ b/bin/omarchy-capture-text @@ -23,4 +23,4 @@ TEXT=$(grim -g "$SELECTION" - | tesseract stdin stdout --oem 1 --psm 6 -l "${OMA [[ -z $TEXT ]] && exit 1 printf "%s" "$TEXT" | wl-copy -omarchy-notification-send -g 󰴑 "Copied text from selection to clipboard" +omarchy-notification-send -g 󰴑 "$(omarchy-text "Copied text from selection to clipboard")" diff --git a/bin/omarchy-chromium-copy-url-host b/bin/omarchy-chromium-copy-url-host index d097ee26..6350b6d0 100755 --- a/bin/omarchy-chromium-copy-url-host +++ b/bin/omarchy-chromium-copy-url-host @@ -18,7 +18,7 @@ copy_url() { [[ -n $url ]] || return 1 printf '%s' "$url" | wl-copy --type text/plain - omarchy-notification-send -g 󰅍 "URL copied to clipboard" + omarchy-notification-send -g 󰅍 "$(omarchy-text "URL copied to clipboard")" } reply_copied() { diff --git a/bin/omarchy-chromium-ytdlp-host b/bin/omarchy-chromium-ytdlp-host index 3911451a..28b43815 100755 --- a/bin/omarchy-chromium-ytdlp-host +++ b/bin/omarchy-chromium-ytdlp-host @@ -87,7 +87,7 @@ download_url() { # Don't show anything until yt-dlp confirms there's actually a video to grab. if ! yt-dlp --no-playlist --simulate --quiet --no-warnings --no-exec --no-exec-before-download -- "$url" >/dev/null 2>&1; then - omarchy-notification-send -u critical -g 󰅖 "No video found for download" "$url" + omarchy-notification-send -u critical -g 󰅖 "$(omarchy-text "No video found for download")" "$url" exit 0 fi @@ -148,7 +148,7 @@ download_url() { # toast would exit before the thumbnail cleanup below is ever scheduled. # `--` keeps mpv from parsing a leading-dash filename as an option; the path # is one discrete argument, so it never reaches a shell. - omarchy-notification-send -g 󰄬 "Download complete" "$title" \ + omarchy-notification-send -g 󰄬 "$(omarchy-text "Download complete")" "$title" \ -t 10000 --image "${preview:-$filepath}" \ --exec mpv -- "$filepath" || true @@ -160,7 +160,7 @@ download_url() { rm -f "$preview" ) & else - omarchy-notification-send -u critical -g 󰅖 "Download failed" "$url" + omarchy-notification-send -u critical -g 󰅖 "$(omarchy-text "Download failed")" "$url" fi exit 0 diff --git a/bin/omarchy-crash-watch b/bin/omarchy-crash-watch index 65fefe55..605cd78e 100755 --- a/bin/omarchy-crash-watch +++ b/bin/omarchy-crash-watch @@ -41,7 +41,7 @@ announce() { --urgency critical \ --glyph "$CRASH_GLYPH" \ "$(omarchy-text "Process crashed: %1" "$comm")" \ - "Click to diagnose with AI" \ + "$(omarchy-text "Click to diagnose with AI")" \ --exec omarchy-agent-crash "$pid" "$comm" "$exe" "$signal" } diff --git a/bin/omarchy-display-text-size b/bin/omarchy-display-text-size index bdf87786..fd510abe 100755 --- a/bin/omarchy-display-text-size +++ b/bin/omarchy-display-text-size @@ -169,7 +169,7 @@ set_terminal_size() { [[ $prev_id =~ ^[0-9]+$ ]] && replace=(-r "$prev_id") local new_id new_id="$(omarchy-notification-send \ - "Restart Foot to apply the new terminal font size" \ + "$(omarchy-text "Restart Foot to apply the new terminal font size")" \ "${replace[@]}" -p 2>/dev/null)" || true [[ $new_id =~ ^[0-9]+$ ]] && printf '%s\n' "$new_id" >"$id_file" fi diff --git a/bin/omarchy-font-set b/bin/omarchy-font-set index 080f055b..d5e8abb7 100755 --- a/bin/omarchy-font-set +++ b/bin/omarchy-font-set @@ -74,11 +74,11 @@ XML omarchy-restart-shell if pgrep -x ghostty; then - omarchy-notification-send -g "You must restart Ghostty to see font change" + omarchy-notification-send -g "$(omarchy-text "You must restart Ghostty to see font change")" fi if pgrep -x foot; then - omarchy-notification-send -g "You must restart Foot to see font change" + omarchy-notification-send -g "$(omarchy-text "You must restart Foot to see font change")" fi omarchy-hook font-set "$font_name" diff --git a/bin/omarchy-games-retro-install b/bin/omarchy-games-retro-install index 9b30bb74..a430f222 100755 --- a/bin/omarchy-games-retro-install +++ b/bin/omarchy-games-retro-install @@ -10,7 +10,7 @@ if (( $# == 0 )); then mapfile -t cores < <(omarchy-games-retro-cores) if (( ${#cores[@]} == 0 )); then - omarchy-notification-send -g 󰯉 "No RetroArch cores found" "/usr/lib/libretro" + omarchy-notification-send -g 󰯉 "$(omarchy-text "No RetroArch cores found")" "/usr/lib/libretro" exit 1 fi @@ -69,4 +69,4 @@ EOF chmod +x "$desktop_file" update-desktop-database "$desktop_dir" &>/dev/null || true -omarchy-notification-send -g 󰯉 "$game_name installed" "Start it with Super + Space" +omarchy-notification-send -g 󰯉 "$(omarchy-text "%1 installed" "$game_name")" "$(omarchy-text "Start it with Super + Space")" diff --git a/bin/omarchy-hyprland-monitor-internal b/bin/omarchy-hyprland-monitor-internal index c0be60fa..dd54d6c6 100755 --- a/bin/omarchy-hyprland-monitor-internal +++ b/bin/omarchy-hyprland-monitor-internal @@ -16,7 +16,7 @@ wake() { on() { if omarchy-hyprland-toggle-enabled $TOGGLE; then omarchy-hyprland-toggle $TOGGLE off - omarchy-notification-send -g 󰍹 "Laptop display enabled" + omarchy-notification-send -g 󰍹 "$(omarchy-text "Laptop display enabled")" fi wake @@ -24,25 +24,25 @@ on() { off() { if [[ -z $INTERNAL ]]; then - omarchy-notification-send -g 󰍹 "No laptop display found" + omarchy-notification-send -g 󰍹 "$(omarchy-text "No laptop display found")" exit 1 fi # The name is written into generated Lua below, so only a plain connector # name may pass; anything else could execute on the next reload. if [[ ! $INTERNAL =~ ^[A-Za-z0-9._-]+$ ]]; then - omarchy-notification-send -g 󰍹 "Refusing unsafe monitor name" + omarchy-notification-send -g 󰍹 "$(omarchy-text "Refusing unsafe monitor name")" exit 1 fi if ! omarchy-hyprland-monitor-external-active; then - omarchy-notification-send -g 󰍹 "Can't disable the only active display" + omarchy-notification-send -g 󰍹 "$(omarchy-text "Can't disable the only active display")" exit 1 fi if omarchy-hyprland-toggle-disabled $TOGGLE && omarchy-hyprland-toggle-disabled $MIRROR_TOGGLE; then printf 'hl.monitor({ output = "%s", disabled = true })\n' "$INTERNAL" >"$TOGGLE_FLAG" - omarchy-notification-send -g 󰍹 "Laptop display disabled" + omarchy-notification-send -g 󰍹 "$(omarchy-text "Laptop display disabled")" hyprctl reload fi } diff --git a/bin/omarchy-hyprland-monitor-internal-mirror b/bin/omarchy-hyprland-monitor-internal-mirror index 9d21511a..c8df5264 100755 --- a/bin/omarchy-hyprland-monitor-internal-mirror +++ b/bin/omarchy-hyprland-monitor-internal-mirror @@ -13,12 +13,12 @@ EXTERNAL=$(hyprctl monitors -j | jq -r '.[] | select(.name | test("^(eDP|LVDS|DS on() { if [[ -z $EXTERNAL ]]; then - omarchy-notification-send -g 󰍹 "No external monitors found for mirror" + omarchy-notification-send -g 󰍹 "$(omarchy-text "No external monitors found for mirror")" exit 1 fi if [[ -z $INTERNAL ]]; then - omarchy-notification-send -g 󰍹 "No laptop monitor found to mirror" + omarchy-notification-send -g 󰍹 "$(omarchy-text "No laptop monitor found to mirror")" exit 1 fi @@ -26,7 +26,7 @@ on() { # names may pass; a user-created headless output can carry any name. for output in "$INTERNAL" "$EXTERNAL"; do if [[ ! $output =~ ^[A-Za-z0-9._-]+$ ]]; then - omarchy-notification-send -g 󰍹 "Refusing unsafe monitor name" + omarchy-notification-send -g 󰍹 "$(omarchy-text "Refusing unsafe monitor name")" exit 1 fi done @@ -43,7 +43,7 @@ on() { off() { if omarchy-hyprland-toggle-enabled $TOGGLE; then omarchy-hyprland-toggle $TOGGLE off - omarchy-notification-send -g 󰍹 "Extended mode restored" + omarchy-notification-send -g 󰍹 "$(omarchy-text "Extended mode restored")" fi } diff --git a/bin/omarchy-hyprland-window-single-square-aspect-toggle b/bin/omarchy-hyprland-window-single-square-aspect-toggle index dd51f28d..782cf552 100755 --- a/bin/omarchy-hyprland-window-single-square-aspect-toggle +++ b/bin/omarchy-hyprland-window-single-square-aspect-toggle @@ -3,6 +3,6 @@ # omarchy:summary=Toggle single-window square aspect ratio. case $(omarchy-hyprland-toggle single-window-aspect-ratio) in - on) omarchy-notification-send -g  "Enable single-window square aspect ratio" ;; - off) omarchy-notification-send -g  "Disable single-window square aspect ratio" ;; + on) omarchy-notification-send -g  "$(omarchy-text "Enable single-window square aspect ratio")" ;; + off) omarchy-notification-send -g  "$(omarchy-text "Disable single-window square aspect ratio")" ;; esac diff --git a/bin/omarchy-launch-config-editor b/bin/omarchy-launch-config-editor index ffe100e9..f4c475b8 100755 --- a/bin/omarchy-launch-config-editor +++ b/bin/omarchy-launch-config-editor @@ -11,5 +11,5 @@ if [[ -z $path ]]; then exit 1 fi -omarchy-notification-send -u low "Editing config file" "$path" +omarchy-notification-send -u low "$(omarchy-text "Editing config file")" "$path" exec omarchy-launch-editor "$path" diff --git a/bin/omarchy-launch-screensaver b/bin/omarchy-launch-screensaver index 78cf7571..d67fae8a 100755 --- a/bin/omarchy-launch-screensaver +++ b/bin/omarchy-launch-screensaver @@ -16,7 +16,7 @@ terminal=$(xdg-terminal-exec --print-id) case $terminal in *Alacritty* | *ghostty* | *foot* | *kitty*) ;; *) - omarchy-notification-send -g ✋ "Screensaver only runs in Alacritty, Foot, Ghostty, or Kitty" + omarchy-notification-send -g ✋ "$(omarchy-text "Screensaver only runs in Alacritty, Foot, Ghostty, or Kitty")" exit 1 ;; esac diff --git a/bin/omarchy-menu-share b/bin/omarchy-menu-share index 57d94bea..315352fd 100755 --- a/bin/omarchy-menu-share +++ b/bin/omarchy-menu-share @@ -33,7 +33,7 @@ else picked=$(omarchy-file-select "${select_args[@]}") || status=$? if ((${status:-0} > 1)); then - omarchy-notification-send -g "" -u critical "Could not share" "The file chooser did not open" + omarchy-notification-send -g "" -u critical "$(omarchy-text "Could not share")" "$(omarchy-text "The file chooser did not open")" exit 1 fi diff --git a/bin/omarchy-migrate-notify b/bin/omarchy-migrate-notify index ae0ef9a1..be2bdf21 100755 --- a/bin/omarchy-migrate-notify +++ b/bin/omarchy-migrate-notify @@ -40,7 +40,7 @@ fi # The shell keeps the click command with the toast, so this oneshot can hand the # invitation over and exit instead of staying activated until it is answered. -omarchy-notification-send -u critical -g  "Pending Omarchy Migrations" "$message" \ +omarchy-notification-send -u critical -g  "$(omarchy-text "Pending Omarchy Migrations")" "$message" \ --exec omarchy-launch-floating-terminal-with-presentation omarchy-migrate && exit 0 # Reached when the notification could not be handed off, so fall back to telling diff --git a/bin/omarchy-plugin-clone b/bin/omarchy-plugin-clone index 59ca1617..c83dba46 100755 --- a/bin/omarchy-plugin-clone +++ b/bin/omarchy-plugin-clone @@ -159,8 +159,8 @@ done omarchy-plugin-enable "$new_id" >/dev/null clone_complete=1 omarchy-notification-send -g 󰐱 \ - "Editing Cloned Plugin" \ - "Original plugin has been replace by clone." + "$(omarchy-text "Editing Cloned Plugin")" \ + "$(omarchy-text "Original plugin has been replace by clone.")" echo "Cloned $source_id to $target_dir and switched to $new_id" if (( edit_clone )); then # Word-splitting is deliberate: EDITOR may carry flags. diff --git a/bin/omarchy-reminder b/bin/omarchy-reminder index e6df57d1..58d354f0 100755 --- a/bin/omarchy-reminder +++ b/bin/omarchy-reminder @@ -57,16 +57,16 @@ show_reminders() { [[ -f $reminder_dir/${timer%.timer}.message ]] && reminder_message=$(<"$reminder_dir/${timer%.timer}.message") if [[ -n $reminder_message ]]; then - body+="$reminder_message in $(format_remaining $remaining) ($(date -d "@$next" +%-H:%M))"$'\n' + body+="$(omarchy-text "%1 in %2 (%3)" "$reminder_message" "$(format_remaining $remaining)" "$(date -d "@$next" +%-H:%M)")"$'\n' else body+="$(omarchy-text "%1-min reminder in %2 (%3)" "$reminder_minutes" "$(format_remaining $remaining)" "$(date -d "@$next" +%-H:%M)")"$'\n' fi done < <(active_reminder_timers "$now") if [[ -z $body ]]; then - omarchy-notification-send -g 󰢌 "Upcoming reminders" "No outstanding reminders" + omarchy-notification-send -g 󰢌 "$(omarchy-text "Upcoming reminders")" "$(omarchy-text "No outstanding reminders")" else - omarchy-notification-send -g 󰢌 "Upcoming reminders" "${body%$'\n'}" + omarchy-notification-send -g 󰢌 "$(omarchy-text "Upcoming reminders")" "${body%$'\n'}" fi } @@ -75,7 +75,8 @@ show_json() { local reminder_dir="${XDG_RUNTIME_DIR:-/tmp}/omarchy-reminders" local now=$(date +%s) local count=0 - local tooltip="Set Reminder" + local tooltip + tooltip=$(omarchy-text "Set Reminder") while IFS=$'\t' read -r timer next; do count=$((count + 1)) @@ -109,9 +110,9 @@ show_json() { done < <(active_reminder_timers "$now") if ((count == 1)); then - tooltip="1 reminder" + tooltip=$(omarchy-text "1 reminder") elif ((count > 1)); then - tooltip="$count reminders" + tooltip=$(omarchy-text "%1 reminders" "$count") fi jq -cn --argjson count "$count" --arg tooltip "$tooltip" --argjson reminders "$reminders_json" '{count:$count,active:($count > 0),tooltip:$tooltip,reminders:$reminders}' @@ -129,7 +130,7 @@ clear_reminders() { rm -f "$reminder_dir"/omarchy-reminder-*.message 2>/dev/null || true refresh_indicator - omarchy-notification-send -g 󰢌 "All reminders have been cleared" + omarchy-notification-send -g 󰢌 "$(omarchy-text "All reminders have been cleared")" } usage() { @@ -195,7 +196,7 @@ if [[ -n $custom_message ]]; then fi systemd-run --user --quiet --collect --on-active="${minutes}m" --unit="$unit" \ - bash -c 'omarchy-notification-send -g 󰢌 "Reminder" "$1"; rm -f "$2"; omarchy-shell -q omarchy.indicators refresh >/dev/null 2>&1 || true' bash "$message" "$message_file" + bash -c 'omarchy-notification-send -g 󰢌 "$(omarchy-text "Reminder")" "$1"; rm -f "$2"; omarchy-shell -q omarchy.indicators refresh >/dev/null 2>&1 || true' bash "$message" "$message_file" refresh_indicator omarchy-notification-send -g 󰢌 "$confirmation_title" "$confirmation" diff --git a/bin/omarchy-system-logout b/bin/omarchy-system-logout index cb0fd660..d4e2bdcf 100755 --- a/bin/omarchy-system-logout +++ b/bin/omarchy-system-logout @@ -6,7 +6,7 @@ nohup bash -c "sleep 2 && uwsm stop" >/dev/null 2>&1 & -omarchy-osd -i logout -m "Logging out" -d 5000 +omarchy-osd -i logout -m "$(omarchy-text "Logging out")" -d 5000 # Now close all windows omarchy-hyprland-window-close-all diff --git a/bin/omarchy-system-reboot b/bin/omarchy-system-reboot index 4d2b6c86..f0d14955 100755 --- a/bin/omarchy-system-reboot +++ b/bin/omarchy-system-reboot @@ -8,7 +8,7 @@ # scope cannot terminate it before it runs. systemd-run --user --collect --quiet --on-active="2s" --timer-property=AccuracySec=100ms systemctl reboot --no-wall || exit 1 -omarchy-osd -i reboot -m "Rebooting" -d 5000 +omarchy-osd -i reboot -m "$(omarchy-text "Rebooting")" -d 5000 omarchy-state clear re*-required diff --git a/bin/omarchy-system-shutdown b/bin/omarchy-system-shutdown index 74b091f5..75731dd0 100755 --- a/bin/omarchy-system-shutdown +++ b/bin/omarchy-system-shutdown @@ -7,7 +7,7 @@ if [[ ${1:-} == "--inhibited" ]]; then # Close windows in the background so they cannot delay power-off. ( - omarchy-osd -i shutdown -m "Shutting down" -d 5000 + omarchy-osd -i shutdown -m "$(omarchy-text "Shutting down")" -d 5000 omarchy-state clear re*-required omarchy-hyprland-window-close-all ) & @@ -21,7 +21,7 @@ elif [[ ${1:-} == "--inhibit" ]]; then --who=Omarchy --why="Shutdown in progress" --mode=block \ "$0" --inhibited || { status=$? - omarchy-notification-send -u critical "Shutdown failed" "Could not complete shutdown. Please try again." + omarchy-notification-send -u critical "$(omarchy-text "Shutdown failed")" "$(omarchy-text "Could not complete shutdown. Please try again.")" exit "$status" } else diff --git a/bin/omarchy-system-sleep-lock b/bin/omarchy-system-sleep-lock index 1e1ccfe6..aa1cf6fa 100755 --- a/bin/omarchy-system-sleep-lock +++ b/bin/omarchy-system-sleep-lock @@ -98,7 +98,7 @@ report_unsecured() { "$1" >&2 omarchy-notification-send -u critical -g 󰌾 \ - "Screen did not lock before suspend" \ + "$(omarchy-text "Screen did not lock before suspend")" \ "$(omarchy-text "The session was left unlocked (%1)." "$1")" >/dev/null 2>&1 || true exit 1 diff --git a/bin/omarchy-tailscale-send b/bin/omarchy-tailscale-send index f8d736b2..fb411bbc 100755 --- a/bin/omarchy-tailscale-send +++ b/bin/omarchy-tailscale-send @@ -28,7 +28,7 @@ if ((${#files[@]} == 0)); then if ((${status:-0} > 1)); then omarchy-notification-send -g "󰒊" -u critical "$(omarchy-text "Could not send to %1" "$name")" \ - "The file chooser did not open" + "$(omarchy-text "The file chooser did not open")" exit 1 fi diff --git a/bin/omarchy-theme-bg-next b/bin/omarchy-theme-bg-next index f9907d7a..1d0f7152 100755 --- a/bin/omarchy-theme-bg-next +++ b/bin/omarchy-theme-bg-next @@ -17,7 +17,7 @@ mapfile -d '' -t BACKGROUNDS < <( TOTAL=${#BACKGROUNDS[@]} if (( TOTAL == 0 )); then - omarchy-notification-send "No background was found for theme" -t 2000 + omarchy-notification-send "$(omarchy-text "No background was found for theme")" -t 2000 else # Get current background from symlink if [[ -L $CURRENT_BACKGROUND_LINK ]]; then diff --git a/bin/omarchy-theme-remove b/bin/omarchy-theme-remove index 7e58289f..4b77e7d4 100755 --- a/bin/omarchy-theme-remove +++ b/bin/omarchy-theme-remove @@ -35,5 +35,5 @@ fi # Now remove the theme directory for THEME_NAME rm -rf "$THEME_PATH" -omarchy-notification-send "Theme removed" "$THEME_NAME" || true +omarchy-notification-send "$(omarchy-text "Theme removed")" "$THEME_NAME" || true echo "Removed $THEME_NAME" diff --git a/bin/omarchy-theme-set b/bin/omarchy-theme-set index 10faf872..ea5a3d21 100755 --- a/bin/omarchy-theme-set +++ b/bin/omarchy-theme-set @@ -175,7 +175,7 @@ set_theme_background() { if [[ -z $CHOSEN_THEME_BACKGROUND || ! -f $CHOSEN_THEME_BACKGROUND ]]; then if ! choose_theme_background; then - omarchy-notification-send "No background was found for theme" -t 2000 + omarchy-notification-send "$(omarchy-text "No background was found for theme")" -t 2000 shell_ipc shell applyTheme "$colors_payload" "$shell_payload" || true return fi diff --git a/bin/omarchy-toggle-animations b/bin/omarchy-toggle-animations index 3040461a..cb2993ac 100755 --- a/bin/omarchy-toggle-animations +++ b/bin/omarchy-toggle-animations @@ -16,7 +16,7 @@ off) omarchy-hyprland-toggle no-animations on ;; esac if omarchy-hyprland-toggle-enabled no-animations; then - omarchy-notification-send -g 󰕟 "Animations disabled" + omarchy-notification-send -g 󰕟 "$(omarchy-text "Animations disabled")" else - omarchy-notification-send -g 󰕟 "Animations enabled" + omarchy-notification-send -g 󰕟 "$(omarchy-text "Animations enabled")" fi diff --git a/bin/omarchy-toggle-crash-capture b/bin/omarchy-toggle-crash-capture index 1b4fb8b6..9135aa5f 100755 --- a/bin/omarchy-toggle-crash-capture +++ b/bin/omarchy-toggle-crash-capture @@ -11,8 +11,8 @@ omarchy-toggle crash-capture-off # starting only settles this session; the next login reads the flag itself. if omarchy-toggle-enabled crash-capture-off; then systemctl --user stop omarchy-crash-watch.service - omarchy-notification-send -g "$CRASH_GLYPH" "Crash capture disabled" + omarchy-notification-send -g "$CRASH_GLYPH" "$(omarchy-text "Crash capture disabled")" else systemctl --user start omarchy-crash-watch.service - omarchy-notification-send -g "$CRASH_GLYPH" "Crash capture enabled" + omarchy-notification-send -g "$CRASH_GLYPH" "$(omarchy-text "Crash capture enabled")" fi diff --git a/bin/omarchy-toggle-screensaver b/bin/omarchy-toggle-screensaver index 8f631318..a6bba188 100755 --- a/bin/omarchy-toggle-screensaver +++ b/bin/omarchy-toggle-screensaver @@ -5,7 +5,7 @@ omarchy-toggle screensaver-off if omarchy-toggle-enabled screensaver-off; then - omarchy-notification-send -g 󱄄 "Screensaver disabled" + omarchy-notification-send -g 󱄄 "$(omarchy-text "Screensaver disabled")" else - omarchy-notification-send -g 󱄄 "Screensaver enabled" + omarchy-notification-send -g 󱄄 "$(omarchy-text "Screensaver enabled")" fi diff --git a/bin/omarchy-toggle-suspend b/bin/omarchy-toggle-suspend index 736e23d4..e22fabb1 100755 --- a/bin/omarchy-toggle-suspend +++ b/bin/omarchy-toggle-suspend @@ -5,7 +5,7 @@ omarchy-toggle suspend-off if omarchy-toggle-enabled suspend-off; then - omarchy-notification-send -g 󰒲 "Suspend removed from system menu" + omarchy-notification-send -g 󰒲 "$(omarchy-text "Suspend removed from system menu")" else - omarchy-notification-send -g 󰒲 "Suspend now available in system menu" + omarchy-notification-send -g 󰒲 "$(omarchy-text "Suspend now available in system menu")" fi diff --git a/bin/omarchy-toggle-theme-sync b/bin/omarchy-toggle-theme-sync index c65a7d52..e6a7362c 100755 --- a/bin/omarchy-toggle-theme-sync +++ b/bin/omarchy-toggle-theme-sync @@ -5,7 +5,7 @@ omarchy-toggle herdr-theme-sync if omarchy-toggle-enabled herdr-theme-sync; then - omarchy-notification-send -g 󰸌 "Herdr theme sync enabled" + omarchy-notification-send -g 󰸌 "$(omarchy-text "Herdr theme sync enabled")" else - omarchy-notification-send -g 󰸌 "Herdr theme sync disabled" + omarchy-notification-send -g 󰸌 "$(omarchy-text "Herdr theme sync disabled")" fi diff --git a/bin/omarchy-transcode b/bin/omarchy-transcode index 5f0bcd6b..1101a20c 100755 --- a/bin/omarchy-transcode +++ b/bin/omarchy-transcode @@ -193,7 +193,7 @@ main() { output=$(output_path "$input" "$format" "$resolution") if [[ $type == "video" ]]; then - omarchy-notification-send -g  "Transcoding video…" "$(omarchy-text "%1 to %2 (%3)" "$(basename -- "$input")" "$format" "$resolution")" + omarchy-notification-send -g  "$(omarchy-text "Transcoding video…")" "$(omarchy-text "%1 to %2 (%3)" "$(basename -- "$input")" "$format" "$resolution")" transcode_video "$input" "$format" "$resolution" "$output" copy_to_clipboard "$output" omarchy-notification-send -g  "$(omarchy-text "Transcoded to %1 %2" "$resolution" "$format")" "Saved and copied to clipboard." diff --git a/bin/omarchy-tui-remove b/bin/omarchy-tui-remove index 87dab9b8..6e990a07 100755 --- a/bin/omarchy-tui-remove +++ b/bin/omarchy-tui-remove @@ -37,5 +37,5 @@ icon_name=$(printf '%s\n' "$APP_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^[: rm -f "$DESKTOP_DIR/$APP_NAME.desktop" rm -f "$ICON_DIR/$icon_name.png" "$ICON_DIR/$APP_NAME.png" "$OLD_ICON_DIR/$APP_NAME.png" if [[ ${OMARCHY_REMOVE_NOTIFY:-true} != "false" ]]; then - omarchy-notification-send -g  "TUI removed" "$APP_NAME" + omarchy-notification-send -g  "$(omarchy-text "TUI removed")" "$APP_NAME" fi diff --git a/bin/omarchy-voxtype-install b/bin/omarchy-voxtype-install index 1fd19f9d..9c26957b 100755 --- a/bin/omarchy-voxtype-install +++ b/bin/omarchy-voxtype-install @@ -22,5 +22,5 @@ if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then hyprctl reload >/dev/null omarchy-restart-shell - omarchy-notification-send -g  "Voxtype Dictation Ready" "Hold F9 to dictate (or toggle with Super + Ctrl + X)." -t 10000 + omarchy-notification-send -g  "$(omarchy-text "Voxtype Dictation Ready")" "$(omarchy-text "Hold F9 to dictate (or toggle with Super + Ctrl + X).")" -t 10000 fi diff --git a/bin/omarchy-webapp-remove b/bin/omarchy-webapp-remove index b3244637..3324282d 100755 --- a/bin/omarchy-webapp-remove +++ b/bin/omarchy-webapp-remove @@ -56,6 +56,6 @@ rm -f "${desktop_file:-$DESKTOP_DIR/$APP_NAME.desktop}" rm -f "$ICON_DIR/$icon_name.png" "$ICON_DIR/$APP_NAME.png" "$OLD_ICON_DIR/$APP_NAME.png" if [[ ${OMARCHY_REMOVE_NOTIFY:-true} != "false" ]]; then - omarchy-notification-send -g  "Web app removed" "$APP_NAME" + omarchy-notification-send -g  "$(omarchy-text "Web app removed")" "$APP_NAME" fi update-desktop-database "$DESKTOP_DIR" &>/dev/null diff --git a/bin/omarchy-windows-vm b/bin/omarchy-windows-vm index 96a8d575..1ee9b322 100755 --- a/bin/omarchy-windows-vm +++ b/bin/omarchy-windows-vm @@ -1414,7 +1414,7 @@ launch_windows() { if ! priv up_wait; then echo "❌ Failed to start Windows VM!" echo " Try checking: omarchy-windows-vm status" - omarchy-notification-send -u critical "Windows VM" "Failed to start Windows VM" + omarchy-notification-send -u critical "$(omarchy-text "Windows VM")" "$(omarchy-text "Failed to start Windows VM")" exit 1 fi diff --git a/install/user/first-run/install-voxtype.hook b/install/user/first-run/install-voxtype.hook index 1d07daa6..476e4aad 100644 --- a/install/user/first-run/install-voxtype.hook +++ b/install/user/first-run/install-voxtype.hook @@ -3,7 +3,7 @@ set -e if omarchy-done ensure voxtype-install-invitation; then - omarchy-notification-send -u critical -g  "Install Dictation with Voxtype" \ - "Click to install voice dictation for Omarchy." \ + omarchy-notification-send -u critical -g  "$(omarchy-text "Install Dictation with Voxtype")" \ + "$(omarchy-text "Click to install voice dictation for Omarchy.")" \ --exec omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install fi diff --git a/install/user/first-run/setup-agent.hook b/install/user/first-run/setup-agent.hook index 90596b83..9f969a6b 100644 --- a/install/user/first-run/setup-agent.hook +++ b/install/user/first-run/setup-agent.hook @@ -5,7 +5,7 @@ set -e # Omarchy ships no default agent, so invite once rather than picking one. An # agent already chosen means the invitation has nothing to offer. if [[ -z $(omarchy-default-agent) ]] && omarchy-done ensure agent-setup-invitation; then - omarchy-notification-send -u critical -g 󰚩 "Set your default agent" \ - "Let your favorite agent help with Omarchy." \ + omarchy-notification-send -u critical -g 󰚩 "$(omarchy-text "Set your default agent")" \ + "$(omarchy-text "Let your favorite agent help with Omarchy.")" \ --exec omarchy menu summon setup.default.agent fi diff --git a/install/user/first-run/setup-fingerprint.hook b/install/user/first-run/setup-fingerprint.hook index 2861eef0..b3a79c8d 100644 --- a/install/user/first-run/setup-fingerprint.hook +++ b/install/user/first-run/setup-fingerprint.hook @@ -6,7 +6,7 @@ set -e # PAM file is the last thing the setup writes on success). if omarchy-hw-fingerprint && [[ ! -f /etc/pam.d/omarchy-lock-fingerprint ]] && omarchy-done ensure fingerprint-setup-invitation; then - omarchy-notification-send -u critical -g 󰈷 "Setup Fingerprint Reader" \ - "Enable sudo and unlocking with your fingerprint." \ + omarchy-notification-send -u critical -g 󰈷 "$(omarchy-text "Setup Fingerprint Reader")" \ + "$(omarchy-text "Enable sudo and unlocking with your fingerprint.")" \ --exec omarchy-launch-floating-terminal-with-presentation omarchy-setup-security-fingerprint fi diff --git a/install/user/first-run/welcome.sh b/install/user/first-run/welcome.sh index 22e6629e..e7c64d55 100644 --- a/install/user/first-run/welcome.sh +++ b/install/user/first-run/welcome.sh @@ -1,5 +1,5 @@ # Real newlines, not a literal \n: the card renders the body as it arrives, and # elides past three lines. -omarchy-notification-send -u critical -g  "Learn Keybindings" \ - $'Super + K for cheatsheet.\nSuper + Space for Omarchy Menu.' \ +omarchy-notification-send -u critical -g  "$(omarchy-text "Learn Keybindings")" \ + "$(omarchy-text $'Super + K for cheatsheet.\nSuper + Space for Omarchy Menu.')" \ --exec omarchy-menu-keybindings diff --git a/install/user/first-run/wifi.sh b/install/user/first-run/wifi.sh index 3b2af23a..223b7c74 100644 --- a/install/user/first-run/wifi.sh +++ b/install/user/first-run/wifi.sh @@ -1,10 +1,10 @@ notify_update() { - omarchy-notification-send -u critical -g  "Update System" "Click to update the system." \ + omarchy-notification-send -u critical -g  "$(omarchy-text "Update System")" "$(omarchy-text "Click to update the system.")" \ --exec omarchy-launch-floating-terminal-with-presentation omarchy-update } notify_wifi() { - omarchy-notification-send -u critical -g 󰖩 "Setup Wi-Fi" "Click to configure the wireless network." \ + omarchy-notification-send -u critical -g 󰖩 "$(omarchy-text "Setup Wi-Fi")" "$(omarchy-text "Click to configure the wireless network.")" \ --exec omarchy-shell shell toggle omarchy.network } diff --git a/plans/omarchycn.md b/plans/omarchycn.md index e4e6cb1a..f2390c70 100644 --- a/plans/omarchycn.md +++ b/plans/omarchycn.md @@ -38,7 +38,7 @@ Progress source of truth for the `omarchycn` branches of `omarchy`, `omarchy-iso - [x] T14 Chinese installer (owner request, parity with the old OmarchyCN ISO): choosing China on the VT reruns the installer in cage + foot with CJK fonts and a US keyboard, falling back to the English VT; there the region screen is bilingual and Global returns to the VT; every later installer screen, the shared setup form and the install dashboard read in Chinese - [x] T15 Global to China fails on local-source installs (owner report): `rime-ice-installer` lives only in the ISO's offline mirror, so a Global install cannot fetch it later; local-source installs install every pinned local build, and `install/config/region.sh` installs the China packages before it writes any region state - [x] T16 A region switch offers to log out at once, since the language and the developer mirrors only reach a new session (owner request) -- [ ] T17 The desktop shell reads in Chinese under `zh_CN` (owner report): notifications, the bar panels (agents, network, display and the rest), the menu's search prompt +- [x] T17 The desktop shell reads in Chinese under `zh_CN` (owner report): notifications, the bar panels (agents, network, display and the rest), the menu's search prompt — review cap reached: five codex rounds; the round-5 findings (user text translated at display, custom reminder list lines, reminder tooltips and errors) are fixed by wording every notification at its sender and verified by tests and in the China VM, without a sixth review ## Acceptance checklist diff --git a/shell/Commons/I18nZh.js b/shell/Commons/I18nZh.js index 96b13372..75870489 100644 --- a/shell/Commons/I18nZh.js +++ b/shell/Commons/I18nZh.js @@ -376,6 +376,12 @@ var table = { // Reminders "Reminder message": "提醒内容", "Remind in minutes": "几分钟后提醒", + "%1 in %2 (%3)": "%1,还有 %2(%3)", + "Set Reminder": "设置提醒", + "1 reminder": "1 个提醒", + "%1 reminders": "%1 个提醒", + "Invalid reminder": "无效的提醒", + "Enter the number of minutes": "输入分钟数", // Notifications "No recent notifications": "没有最近的通知", // Bar diff --git a/shell/plugins/notifications/components/NotificationCard.qml b/shell/plugins/notifications/components/NotificationCard.qml index 4c0fcd90..d7df8d83 100644 --- a/shell/plugins/notifications/components/NotificationCard.qml +++ b/shell/plugins/notifications/components/NotificationCard.qml @@ -44,7 +44,7 @@ BorderSurface { readonly property bool singleLineToast: sanitizedBody.length === 0 readonly property bool collapseRedundantIcon: singleLineToast && !hasGlyph && summaryStartsWithGlyph readonly property string sanitizedBody: sanitizeBody(body) - readonly property string styledBody: NotificationLogic.styledBody(I18n.tr(body), app, appIcon) + readonly property string styledBody: NotificationLogic.styledBody(body, app, appIcon) readonly property color dimColor: Qt.darker(Color.notifications.text, 1.4) readonly property color bodyColor: Qt.darker(Color.notifications.text, 1.15) @@ -168,7 +168,7 @@ BorderSurface { textFormat: Text.PlainText Layout.fillWidth: true visible: root.summary.length > 0 - text: I18n.tr(root.summary) + text: root.summary font.family: "Liberation Sans" color: Color.notifications.text font.pixelSize: Style.font.title diff --git a/shell/plugins/osd/Osd.qml b/shell/plugins/osd/Osd.qml index 6b36f00f..69ddc25b 100644 --- a/shell/plugins/osd/Osd.qml +++ b/shell/plugins/osd/Osd.qml @@ -90,7 +90,7 @@ Item { font.family: Style.font.family font.bold: true font.pixelSize: Style.font.title - text: I18n.tr(root.message) + text: root.message } TextMetrics { @@ -190,7 +190,7 @@ Item { // a hole in the padding; the slack lands in the gap after the bar. horizontalAlignment: root.hasProgress ? Text.AlignRight : Text.AlignLeft anchors.verticalCenter: parent.verticalCenter - text: I18n.tr(root.message) + text: root.message font: messageMetrics.font color: Color.popups.text elide: Text.ElideRight diff --git a/shell/plugins/reminders/ReminderFlow.qml b/shell/plugins/reminders/ReminderFlow.qml index 031dce48..d062f8dc 100644 --- a/shell/plugins/reminders/ReminderFlow.qml +++ b/shell/plugins/reminders/ReminderFlow.qml @@ -74,7 +74,7 @@ Item { } if (!nextMinutes) { - Quickshell.execDetached([root.omarchyPath + "/bin/omarchy-notification-send", "Invalid reminder", "Enter the number of minutes"]) + Quickshell.execDetached([root.omarchyPath + "/bin/omarchy-notification-send", I18n.tr("Invalid reminder"), I18n.tr("Enter the number of minutes")]) return } diff --git a/test/shell.d/notifications-test.sh b/test/shell.d/notifications-test.sh index a3484514..48414ed4 100644 --- a/test/shell.d/notifications-test.sh +++ b/test/shell.d/notifications-test.sh @@ -137,7 +137,7 @@ assertEqual( // belongs in the logic module, where the strip runs after it. const cardQml = fs.readFileSync(path.join(root, 'shell/plugins/notifications/components/NotificationCard.qml'), 'utf8') assert( - /readonly property string styledBody: NotificationLogic\.styledBody\(I18n\.tr\(body\), app, appIcon\)/.test(cardQml), + /readonly property string styledBody: NotificationLogic\.styledBody\(body, app, appIcon\)/.test(cardQml), 'the notification card renders the body that was stripped after the newline rewrite' ) assert(