Skip to content

Add selectable English and Simplified Chinese interface - #122

Open
256051 wants to merge 1 commit into
tobi:mainfrom
256051:feat/selectable-language-zh-cn
Open

256051 wants to merge 1 commit into
tobi:mainfrom
256051:feat/selectable-language-zh-cn

Conversation

@256051

@256051 256051 commented Oct 30, 2026

Copy link
Copy Markdown

The window currently hardcodes English. This adds an English / 简体中文 language chooser that applies immediately without restarting a scan or losing navigation, marks, or the selected source. Refs #111.

  • Open Language / 语言 from the top bar, startup/source chooser, or macOS menu; F2, Tab/Shift-Tab, Enter, Escape, and pointer selection are supported.
  • Save the language atomically in a separate per-user language file beside the existing power preference. English remains the default and fallback. Save failures keep the session usable and show a warning.
  • Localize window controls, progress, category/reclaim labels, relative times, Git summaries, review/deletion confirmation, help, and macOS menus using a small built-in catalog (336 messages), with no new dependencies. The catalog and docs/translations.md provide an entry point for additional languages.

Scanning, deletion guards, SSH protocol, paths, CLI flags, and dependency versions are unchanged. CLI help, exported prompts/scripts, and raw filesystem/SSH diagnostics retain their original wording.

Validation

On Ubuntu 24.04 under WSL, Rust 1.97.1:

  • cargo xtask lint passed.
  • setpriv --bounding-set=-dac_override,-dac_read_search cargo xtask test passed: 271 tests passed, 9 existing tests ignored. This WSL session runs as root; dropping the two permission-bypass capabilities is necessary for the existing unreadable-directory test to exercise real permission denial. That test fails under unrestricted root on the unchanged scanner.
  • cargo build --locked -p disktree-app passed.
  • New window tests cover keyboard and pointer language selection, cancellation, persistence/save failure, returning to the source chooser, preserved scan/marks, Chinese help/review/deletion dialogs, and controls staying inside a 900×600 window. Catalog tests check ordering, fallback, and placeholder preservation; formatting tests ensure inserted paths containing braces remain literal.

Windows and macOS have not been tested on physical machines; their existing CI jobs remain the platform checks.

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