Skip to content

mac: Simplified Chinese localization, language picker, Capacity Dock auto-hide - #1244

Closed
TheCrazyAnt wants to merge 1 commit into
getagentseal:mainfrom
TheCrazyAnt:pr/zh-hans-i18n
Closed

TheCrazyAnt wants to merge 1 commit into
getagentseal:mainfrom
TheCrazyAnt:pr/zh-hans-i18n

Conversation

@TheCrazyAnt

Copy link
Copy Markdown
Contributor

Summary

  • Adds localization support to the macOS menubar app and ships a complete Simplified Chinese translation (zh-Hans, ~720 strings). SwiftUI literal keys resolve through Localizable.strings in the main bundle; plain String UI text goes through two small helpers (L() for literals with interpolation, LR() for labels that arrive at runtime from the CLI payload such as activity names). The English .strings file is generated alongside so English stays the development language. A Settings › General › Language picker (System / English / 简体中文) writes the per-app AppleLanguages default and offers a relaunch.
  • Capacity Dock: optional Auto-hide at screen edge (tucks a docked rail beyond its edge, leaving a hover sliver that slides it back out; off by default), the glance bubble now shows the hovered provider's own "Today" spend from providerDetails instead of the all-provider total, and amounts follow the selected display currency.
  • Menubar/popover fixes: the status-item title is redrawn when the FX rate arrives (non-USD users saw ¥87 for $87 until the next payload change), the popover closes on any outside click via a global mouse-down monitor, an optional monochrome (template) status icon that matches Apple's own menu bar icons, and date labels (calendar, hero header, month picker) follow the UI locale instead of en_US_POSIX.

Relates to #1219 (this covers the macOS menubar app; the CLI and web dashboard are untouched).

Tooling: mac/Scripts/l10n/extract_keys.py lists UI string keys from the Swift sources and merge_strings.py merges translation fragments and reports untranslated keys, so future languages can be added by dropping in another .lproj.

Testing

  • I have tested this locally against real data (not just unit tests) — daily use on macOS 26.6 with Claude Code, Codex, Copilot and Antigravity sessions; screenshots below.
  • npm test passes — 3561 passed, 5 skipped; tests/sharing/connect-timeout.test.ts fails identically on main in this environment (network-dependent), see note.
  • npm run build succeeds
  • swift test — all suites pass (129 XCTest + Swift Testing); swift build -c release clean; mac/Scripts/package-app.sh produces a working universal bundle with en.lproj / zh-Hans.lproj in Contents/Resources.

No changes under src/, dash/ or app/.

…auto-hide and popover fixes

Localization
- Ship Localizable.strings in en.lproj / zh-Hans.lproj inside the main
  bundle so SwiftUI literal keys resolve on their own; plain String UI text
  goes through L() (String(localized:)) and runtime CLI labels through LR().
- Settings › General › Language: System / English / 简体中文, applied via
  the per-app AppleLanguages default with a relaunch button.
- Date labels in the calendar, hero header and month picker follow the UI
  locale instead of en_US_POSIX; short period labels are translatable.
- Scripts/l10n: extract_keys.py lists UI keys, merge_strings.py merges
  translation fragments and reports untranslated keys.

Capacity Dock
- Optional "Auto-hide at screen edge": a docked rail parks beyond its edge
  leaving a hover sliver that slides it back out; off by default.
- The glance bubble shows the hovered provider's own "Today" spend from
  providerDetails and formats amounts in the display currency.

Menubar / popover
- Redraw the status-item title when the FX rate arrives (non-USD users saw
  the symbol swap with unconverted numbers until the next payload change).
- Close the popover on any outside click with a global mouse-down monitor.
- Optional monochrome (template) status icon; quota tint remains available.

Relates to getagentseal#1219 (menubar app only; CLI and dashboard untouched).
@TheCrazyAnt

Copy link
Copy Markdown
Contributor Author

Closing this draft to keep to the one-PR-at-a-time rule: I'm splitting it and starting with a small, self-contained fix (the node-resolution change) in a separate PR. I'll reopen the localization work as its own PR once that one lands, and rebase it onto whatever main looks like by then.

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.

1 participant