feat(lyrics-plus): implement pinyin romanization for Chinese lyrics#3893
feat(lyrics-plus): implement pinyin romanization for Chinese lyrics#3893heinthanth wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds configurable Chinese lyric romanization using pinyin-pro, including romanization settings, conversion state management, and rendering for synced, expanded synced, and unsynced lyrics. ChangesChinese lyric romanization
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant LyricsContainer
participant Translator
participant pinyin-pro
participant SyncedLyricsPage
participant UnsyncedLyricsPage
LyricsContainer->>Translator: convert Chinese lyric lines
Translator->>pinyin-pro: pinyin(text, options)
pinyin-pro-->>Translator: romanized lines
Translator-->>LyricsContainer: converted lyric lines
LyricsContainer->>SyncedLyricsPage: pass romanization prop
LyricsContainer->>UnsyncedLyricsPage: pass romanization prop
SyncedLyricsPage-->>LyricsContainer: render romanized paragraphs
UnsyncedLyricsPage-->>LyricsContainer: render romanized paragraphs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Adds Chinese (Pinyin) romanization support to the Lyrics Plus custom app by introducing a new conversion option and rendering a secondary romanized line under the main lyric line when enabled.
Changes:
- Load
pinyin-proon-demand and add aconvertToPinyin()path inTranslator. - Add “Romanization” selection (Chinese-only) plus a configurable romanization font size in the options UI.
- Generate romanized lyric lines in
LyricsContainerand render them in synced/expanded/unsynced lyric pages.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| CustomApps/lyrics-plus/Translator.js | Adds pinyin-pro external loading + convertToPinyin() for Chinese romanization. |
| CustomApps/lyrics-plus/Pages.js | Renders romanized lines under lyrics for synced/expanded/unsynced views. |
| CustomApps/lyrics-plus/OptionsMenu.js | Adds Romanization selector and romanization font-size adjustment option. |
| CustomApps/lyrics-plus/index.js | Stores new config values, performs romanization conversion, and passes romanization lines into pages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This is one of the features I really wanted to have. So, I implemented Pinyin romanization using
pinyin-propackage.This PR will resolves #3575
Romanization can be turned on or off in the "Conversions" menu. Romanized lyrics will be displayed under original lyrics or "translated" lyrics (if enabled). Also font size for romanized line can be changed in "Adjustments" menu.
Summary by CodeRabbit