[codex] Add Cantonese language option#776
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✅ Files skipped from review due to trivial changes (5)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughCantonese ( ChangesCantonese Language Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
bc65f85 to
255de43
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/models.py`:
- Line 15: The STT_LANGUAGE_PATTERN regex constant excludes Hindi, creating a
mismatch where frontend UI allows selecting Hindi but backend validation rejects
it. Add `hi` to the regex pattern in the STT_LANGUAGE_PATTERN constant alongside
the existing language codes (en, zh, yue, ja, ko, de, fr, ru, pt, es, it) so
that frontend language selections are consistently accepted by backend
validation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1630b0b7-9692-4f30-9147-823a6776e30a
📒 Files selected for processing (7)
app/src/components/ServerTab/CapturesPage.tsxapp/src/i18n/locales/en/translation.jsonapp/src/i18n/locales/zh-CN/translation.jsonapp/src/i18n/locales/zh-TW/translation.jsonapp/src/lib/constants/languages.tsbackend/backends/__init__.pybackend/models.py
| ) | ||
|
|
||
| VOICE_LANGUAGE_PATTERN = "^(zh|yue|en|ja|ko|de|fr|ru|pt|es|it|he|ar|da|el|fi|hi|ms|nl|no|pl|sv|sw|tr)$" | ||
| STT_LANGUAGE_PATTERN = "^(en|zh|yue|ja|ko|de|fr|ru|pt|es|it)$" |
There was a problem hiding this comment.
STT_LANGUAGE_PATTERN still excludes Hindi, which breaks frontend/backend language contract.
At Line 15, STT validation omits hi, but the captures UI still allows selecting hi; those requests can fail validation. Please include hi in the shared STT regex so UI selections are accepted consistently.
Suggested patch
-STT_LANGUAGE_PATTERN = "^(en|zh|yue|ja|ko|de|fr|ru|pt|es|it)$"
+STT_LANGUAGE_PATTERN = "^(en|zh|yue|ja|ko|de|fr|ru|pt|es|it|hi)$"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| STT_LANGUAGE_PATTERN = "^(en|zh|yue|ja|ko|de|fr|ru|pt|es|it)$" | |
| STT_LANGUAGE_PATTERN = "^(en|zh|yue|ja|ko|de|fr|ru|pt|es|it|hi)$" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@backend/models.py` at line 15, The STT_LANGUAGE_PATTERN regex constant
excludes Hindi, creating a mismatch where frontend UI allows selecting Hindi but
backend validation rejects it. Add `hi` to the regex pattern in the
STT_LANGUAGE_PATTERN constant alongside the existing language codes (en, zh,
yue, ja, ko, de, fr, ru, pt, es, it) so that frontend language selections are
consistently accepted by backend validation.
Summary
yue) as an explicit language option for capture transcription/STT settingsyue) to Qwen TTS and Qwen CustomVoice language listsyuetocantonesewhen loading backend enginesNotes
Validation
bun run typecheckGenerationRequest,SpeakRequest, andVoiceProfileCreatewithlanguage="yue"yuetocantoneselanguage="yue",engine="qwen",model_size="1.7B"; generation completed successfully with a 4.0s audio result and no backend errorSummary by CodeRabbit