Skip to content

feat(i18n): translate library and playback screens - #911

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
kapok-4o:r13/l10n-zh-screens-playback
Oct 21, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
kapok-4o:r13/l10n-zh-screens-playback

Conversation

@kapok-4o

@kapok-4o kapok-4o commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

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 ..EN and comes in the next PR.
  • Templates keep their placeholders, so folder names, search queries, plugin screen names, device names and custom playbar text are shown exactly as given.
  • The playbar's shuffle, repeat and listening-party segments are translated together, so the status line never mixes Chinese and English.
  • The playbar's Shuffle and Repeat buttons use two-character labels ([随机], [循环]), so the Chinese control row is exactly as wide as the English one (66 columns with the gaps) and fits wherever it does.
  • Two new tests, in both scripts: chinese_screen_templates_keep_user_values_literal checks that a folder name, a search query and a plugin screen name that look like placeholders come out unchanged; chinese_playbar_segments_are_all_translated checks the repeat and listening-party segments.
  • gui/src/bindings/strings.json is regenerated.

English is unchanged.

Testing

macOS (aarch64), on top of 63bad62e:

  • cargo fmt --all --check: clean. cargo clippy --locked -- -D warnings on slim (telemetry,tui): clean.
  • cargo test --locked: slim 1720 passed; default plus local-files,subsonic 2317 passed, 21 ignored; the gui feature set with the five sources 2128 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.

Summary by CodeRabbit

  • New Features
    • Added explicit Simplified Chinese translations for screen labels and playbar sections.
    • Added explicit Traditional Chinese translations for screen labels and playbar sections.
    • Untranslated labels continue to display English text as a fallback.
    • Template placeholders remain unchanged during translation.

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.
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LargeModGames/spotatui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 84802fa9-038b-409c-aaf8-c2e979350201
📥 Commits

Reviewing files that changed from the base of the PR and between 837308b and 6995720.

⛔ Files ignored due to path filters: 1
  • gui/src/bindings/strings.json is excluded by !gui/src/bindings/**
📒 Files selected for processing: 1
  • src/core/i18n/screens.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

📝 Walkthrough

The Simplified and Traditional Chinese screen string constants now include translations for selected labels and controls. Unspecified fields retain English fallback values. Tests cover template value preservation and translated playback segments.

Changes: Screen Localization

Layer / File(s) Summary
Chinese screen strings and tests
src/core/i18n/screens.rs
ZH_HANS and ZH_HANT define translations for screen labels, controls, playback status, metadata, and other text, with EN fallback values for unspecified fields. Tests check literal template values and translated playback segments.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 69957

No concrete issue is identified that should prevent merging after normal checks.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the allowed conventional-commit prefix feat(i18n): and accurately describes the translation of library and playback screens.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit 20b6456 into LargeModGames:main Oct 21, 2026
32 checks passed
LargeModGames pushed a commit that referenced this pull request Oct 22, 2026
# 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]>
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.

2 participants