mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-01 06:36:47 -06:00
### Summary This change centralizes the translation of user-facing error messages in the UI layer while preserving the original error payloads for machine consumption and AI-agent integrations. ### What changed - Added a centralized error-translation path in `i18n.rs`. - The UI now translates only the final display text, instead of altering the underlying engine or protocol error payload. - If a translated string is not available, the original message is kept as a fallback, avoiding broken or overly-simplified output. - The translation logic is applied at the presentation layer, not at the source of the error. ### Updated call sites - Error and alert rendering in `widgets.rs` - Dialog error presentation in `dialogs.rs` - Print and feedback failures in `printing.rs` - Top-level UI error handling in `lib.rs` ### Design intent - Keep the raw engine errors intact for scripts, control channels, and AI/agent integrations. - Present a clearer, localized message only to end users. - Avoid modifying dictionary files or adding new translation entries to the global catalog unnecessarily. - Keep the behavior consistent with the project’s accessibility and internationalization goals. ### Validation - The focused i18n test passed successfully. - The relevant UI test suite passed successfully. - The repository-required CI gate was run and completed without failures according to the latest verification output.