Repository navigation
feat(i18n): translate library and playback screens - #911
Conversation
Translate terminal library tables, devices, playback controls, lyrics, audio and cover-art views into both Chinese scripts. Use the shared templates and preserve custom playbar text.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
# Summary The sixth Chinese translation PR (refs #726), finishing the terminal screen table after the library and playback screens (#911): the discovery, listening statistics, friends, playlist sync and AI DJ screens in Simplified Chinese (`zh-Hans`) and Traditional Chinese with Taiwan wording (`zh-Hant`). - `src/core/i18n/screens.rs`: the remaining 123 screen strings, plus the seven visualizer style names that #905 added (Winamp and Outrun stay as style names). With this, all 259 entries of the screen table have a Chinese translation in both scripts; `..EN` stays only so a new English field compiles before it is translated. - Templates keep their placeholders, so playlist names, friend names, counts and durations are shown exactly as given. - Tests (`src/tui/ui/localization_tests.rs`): `chinese_main_routes_render_in_tiny_and_practical_viewports` draws the main screens in Chinese at very small and ordinary terminal sizes, and `chinese_empty_main_tables_show_translated_titles_at_narrow_widths` checks the empty tables keep their translated titles when narrow. A playbar test in `src/tui/ui/player.rs` now also asserts the translated shuffle and volume segments. - `gui/src/bindings/strings.json` is regenerated. English is unchanged. # Testing macOS (aarch64), with `ee1262c5` merged in: - `cargo fmt --all --check`: clean. `cargo clippy --locked -- -D warnings` on slim (`telemetry,tui`): clean. - `cargo test --locked`: slim 1754 passed; default plus `local-files,subsonic` 2355 passed, 21 ignored; the gui feature set with the five sources 2135 passed, 30 ignored, and no diff in `gui/src/bindings` afterwards. Not run: the Linux-only `all-sources` leg (PipeWire), which CI covers. # Additional notes A native-speaker review of the wording is welcome; any fix is a one-line change in the table. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit - **Localization** - Added Simplified and Traditional Chinese translations for discovery, statistics, friends, playlist sync, AI DJ, visualization styles, and related interface labels. - Added localized text for previously untranslated fields while preserving formatting and placeholders. - **Bug Fixes** - Improved Chinese UI rendering at narrow window widths. - Corrected Traditional Chinese playbar labels for shuffle and volume controls. - **Tests** - Added regression coverage for Chinese layouts across multiple screens and window sizes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: 2570165831 <[email protected]>
Summary
The fifth Chinese translation PR (refs #726), after the dialogs and onboarding: the terminal library and playback screens in Simplified Chinese (
zh-Hans) and Traditional Chinese with Taiwan wording (zh-Hant).src/core/i18n/screens.rs: about half of the screen strings (129 of 252), covering library tables, the devices screen, the playbar and playback controls, lyrics, the audio visualizer and cover art. The rest of the table (discovery, social and DJ screens) still falls back to English through..ENand comes in the next PR.[随机],[循环]), so the Chinese control row is exactly as wide as the English one (66 columns with the gaps) and fits wherever it does.chinese_screen_templates_keep_user_values_literalchecks that a folder name, a search query and a plugin screen name that look like placeholders come out unchanged;chinese_playbar_segments_are_all_translatedchecks the repeat and listening-party segments.gui/src/bindings/strings.jsonis regenerated.English is unchanged.
Testing
macOS (aarch64), on top of
63bad62e:cargo fmt --all --check: clean.cargo clippy --locked -- -D warningson slim (telemetry,tui): clean.cargo test --locked: slim 1720 passed; default pluslocal-files,subsonic2317 passed, 21 ignored; the gui feature set with the five sources 2128 passed, 30 ignored, and no diff ingui/src/bindingsafterwards.Not run: the Linux-only
all-sourcesleg (PipeWire), which CI covers.Additional notes
A native-speaker review of the wording is welcome; any fix is a one-line change in the table.
Summary by CodeRabbit