feat(i18n): localize all queue command messages across 7 locales
Summary
Localize all 15 user-facing strings in the /queue command (list/edit/drop/clear) across all 7 shipped locales.
Changes
localization.rs— 15 newCmdQueue*MessageId variants with translations in En, Ja, ZhHans, Vi, PtBr, Es419 (ZhHant falls through to ZhHans)queue.rs— wirequeue()/list_queue()/edit_queue()/drop_queue()/clear_queue()/parse_index()throughtr(locale, MessageId)with named placeholders ({count},{index})
Testing
- All 14 existing queue tests pass (set
app.ui_locale = Locale::Enfor deterministic assertions) - New
queue_messages_are_localizedsmokes ZhHans output for已排队的消息/提示 - fmt + clippy clean
Greptile Summary
This PR localizes all 15 user-facing strings in the /queue command family across 7 shipped locales by adding CmdQueue* MessageId variants to localization.rs and threading tr(locale, …) calls through queue.rs. Existing tests are updated to pin Locale::En for deterministic assertions and one ZhHans smoke test is added; two unrelated stall-watchdog timing tests in tests.rs are also refactored to avoid potentially panicking Instant subtraction, but these changes are bundled into the i18n PR.
localization.rs: 15 new enum variants added to bothMessageIdandALL_MESSAGE_IDS; translations provided for En, Ja, ZhHans, Vi, PtBr, Es419 with ZhHant delegating to Simplified Chinese via the existingother => chinese_simplified(other)?catch-all intraditional_chinese().queue.rs: Each sub-function now readsapp.ui_localeand substitutes named placeholders ({count},{index}) via.replace();parse_indexreturn type widened fromResult<usize, &'static str>toResult<usize, String>to accommodate owned translated error strings.tests.rs: Timing tests forreconcile_turn_livenessrewritten to compute allInstantvalues as forward offsets fromInstant::now()rather than subtracting large durations, which is the correct approach for cross-platform stability.
Confidence Score: 5/5
The queue command localization is mechanical and complete — all 15 strings are covered in every translation function, placeholder substitution is straightforward .replace() calls on static strings, and the fallback chain to English is preserved. No behavioural changes to queue logic.
The change is purely additive: new enum variants, new match arms in translation functions, and call-site wiring. The queue logic itself is unchanged; the only risk surface is a missing or mismatched placeholder ({count}, {index}), and a quick check shows every locale's strings contain the expected placeholder tokens. ZhHant intentionally delegates to Simplified Chinese via the existing catch-all. The two timing test rewrites are correct and logically equivalent to what they replace.
No files require special attention. The tests.rs timing changes are unrelated but harmless.
Important Files Changed
| Filename | Overview |
|---|---|
| crates/tui/src/commands/queue.rs | All queue subcommands (list/edit/drop/clear) wired through tr(locale, MessageId::*), parse_index return type updated to Result<usize, String>, existing tests updated to fix locale and assert against translated strings, and a new ZhHans smoke test added. |
| crates/tui/src/localization.rs | 15 new CmdQueue* MessageId variants added to the enum and ALL_MESSAGE_IDS slice; English strings defined in english() and all 6 non-English translation functions updated; ZhHant falls through to chinese_simplified via the existing catch-all. |
| crates/tui/src/tui/ui/tests.rs | Two unrelated stall-watchdog timing tests refactored to avoid subtracting a large Duration from Instant::now() (which can panic on Windows near boot); the arithmetic is logically equivalent but bundled into this i18n PR. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["queue(app, args)"] --> B{arg}
B -->|empty / list| C["list_queue(app)"]
B -->|edit| D["edit_queue(app, index)"]
B -->|drop/remove/rm| E["drop_queue(app, index)"]
B -->|clear| F["clear_queue(app)"]
B -->|other| G["tr(locale, CmdQueueUsage)\nCommandResult::error"]
C --> C1["tr(locale, CmdQueueDraftHeader)"]
C --> C2["tr(locale, CmdQueueNoMessages)"]
C --> C3["tr(locale, CmdQueueListHeader)\n.replace('{count}', n)"]
C --> C4["tr(locale, CmdQueueTip)"]
D --> P["parse_index(index, locale)"]
E --> P
P -->|Err| PE["tr(locale, CmdQueueMissingIndex\n/ CmdQueueIndexPositive\n/ CmdQueueIndexMin)"]
P -->|Ok| D2["tr(locale, CmdQueueEditingMessage)\n.replace('{index}', n)"]
P -->|Ok| E2["tr(locale, CmdQueueDropped)\n.replace('{index}', n)"]
F --> F1["tr(locale, CmdQueueAlreadyEmpty\n/ CmdQueueCleared)"]
subgraph Localization
TR["tr(locale, id)\n→ translation(locale,id)\n or english(id)"]
En["english()"]
Ja["japanese()"]
ZhHans["chinese_simplified()"]
ZhHant["traditional_chinese()\n→ falls through to ZhHans"]
PtBr["portuguese_brazil()"]
Es419["spanish_latin_america()"]
Vi["vietnamese()"]
TR --> En & Ja & ZhHans & ZhHant & PtBr & Es419 & Vi
end
Reviews (2): Last reviewed commit: "fix: restore two-line draft header layou..." | Re-trigger Greptile
[!WARNING] You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!
Thanks @gordonlu. This is a useful i18n cleanup and the queue-command surface is worth localizing.
I reviewed the code/tests and the remaining blocker is mechanical: CI lint fails at cargo fmt --all -- --check in crates/tui/src/tui/ui/tests.rs around the Windows-safe Instant test hardening. Please run cargo fmt --all, push the formatted result, and rerun CI.
Once formatting is clean, this looks like a reasonable follow-up harvest candidate. I am keeping it out of the v0.8.50 release branch for now only because the release branch is already in final stabilization, not because the idea is weak.
Hey @gordonlu — the queue command i18n has been harvested into v0.8.50 (#2504)! All 15 user-facing strings across 7 locales landed cleanly. Really appreciate the thorough approach with the smoke test verifying ZhHans output — that's the kind of attention to detail that makes i18n PRs safe to merge. Thank you! 🌐🐋
This was harvested into the v0.8.50 release — thank you for the contribution!