Problem
The localization strings in the current project are centralized in crates/tui/src/localization.rs. This file has exceeded 5,000 lines and is entirely hard-coded, which may lead to low maintainability, affect compilation speed, and create difficulties in using translation toolchains.
Proposed solution
Consider introducing a mature Rust i18n library, such as fluent-rs or rust-i18n, and moving the localization translations to dedicated localization files.
Impact
- Increased dependencies: Adding 2–3 new crates, but they are mature and well-maintained. This will slightly increase build dependencies, yet the benefits far outweigh the costs.
- Performance overhead: Most i18n libraries have been thoroughly optimized, so the performance difference compared to hard‑coded strings should be negligible.
- Migration effort: The workload is relatively large and may introduce logic changes, so a detailed refactoring plan needs to be discussed.
Problem
The localization strings in the current project are centralized in
crates/tui/src/localization.rs. This file has exceeded 5,000 lines and is entirely hard-coded, which may lead to low maintainability, affect compilation speed, and create difficulties in using translation toolchains.Proposed solution
Consider introducing a mature Rust i18n library, such as
fluent-rsorrust-i18n, and moving the localization translations to dedicated localization files.Impact