Add zh-HK Cantonese support and update installation instructions#1
Add zh-HK Cantonese support and update installation instructions#1dr-data wants to merge 11 commits into
Conversation
Agent-Logs-Url: https://github.com/dr-data/claude-code-voice/sessions/5e20a66c-3c6f-4aa8-acc8-18be1d616635 Co-authored-by: dr-data <9060623+dr-data@users.noreply.github.com>
Add `zh-hk` Cantonese routing to Apple STT
Agent-Logs-Url: https://github.com/dr-data/claude-code-voice/sessions/f84746a7-3030-4e9b-92dd-fa9162d46f43 Co-authored-by: dr-data <9060623+dr-data@users.noreply.github.com>
…-instructions Update README install source, clarify token/local STT behavior, and simplify architecture diagram
Agent-Logs-Url: https://github.com/dr-data/claude-code-voice/sessions/d6d2558a-42b9-46cf-9919-ea0c1bb7d55e Co-authored-by: dr-data <9060623+dr-data@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dr-data/claude-code-voice/sessions/d6d2558a-42b9-46cf-9919-ea0c1bb7d55e Co-authored-by: dr-data <9060623+dr-data@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dr-data/claude-code-voice/sessions/d6d2558a-42b9-46cf-9919-ea0c1bb7d55e Co-authored-by: dr-data <9060623+dr-data@users.noreply.github.com>
Show supported `/config` language codes in installer completion output
- Add yue, cantonese, 廣東話, 粵語, zh-hk locale mappings → zh-HK Apple STT - Update all install/uninstall URLs from eladcandroid to dr-data Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Detect repo owner from git remote URL so forked copies automatically display correct install/uninstall URLs without hardcoded usernames. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Show yue/zh-hk as accepted /config values for Cantonese - Add step-by-step guide for downloading zh-HK speech model via System Settings → Keyboard → Dictation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds Cantonese (Hong Kong) language handling to the voice server’s language mapping and updates installation/docs to reflect the new language options and a new default GitHub repo owner, with scripts attempting to print fork-correct install/uninstall URLs.
Changes:
- Added Cantonese (
yue/zh-hk+ aliases) to the Swift language→locale mapping for Apple STT. - Updated
setup.sh/uninstall.shto default todr-dataand to derive the GitHub username from the repo remote for printed reinstall/uninstall commands. - Expanded README documentation with a Cantonese setup guide and clarified Anthropic-vs-Apple STT routing.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| uninstall.sh | Derives GitHub username from installed repo and prints reinstall URL. |
| setup.sh | Defaults clone to dr-data, derives GitHub username for printed URLs, and updates displayed supported language codes. |
| scripts/server.swift | Adds yue/zh-hk and Cantonese aliases to Apple STT locale mapping. |
| README.md | Updates install/uninstall URLs, splits Mandarin vs Cantonese, adds Cantonese setup + routing clarifications. |
| CLAUDE.md | Updates supported language list to include zh-hk. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Detect GitHub username from this repo's git remote so forked copies display correct URLs | ||
| _REMOTE_URL=$(git -C "$SCRIPT_DIR" remote get-url origin 2>/dev/null || echo "") | ||
| _GITHUB_USER=$(echo "$_REMOTE_URL" | sed -E 's|.*github\.com[:/]([^/]+)/.*|\1|') | ||
| _GITHUB_USER="${_GITHUB_USER:-dr-data}" |
There was a problem hiding this comment.
GitHub username extraction falls back incorrectly when origin is not a GitHub URL: the sed substitution returns the original URL unchanged (non-empty), so _GITHUB_USER becomes something like https://gitlab... and the raw.githubusercontent.com links printed later will be invalid. Consider extracting with a pattern that outputs only on match (e.g., sed -nE ...p) and/or explicitly validating the result before using the default.
| echo "Supported /config language codes:" | ||
| echo " en, es, fr, de, ja, ko, pt, it, ru, hi, id, pl, tr, nl, uk, el, cs, da, sv, no, he, ar, zh, zh-hk" | ||
| echo " plus any language supported by Apple SFSpeechRecognizer" |
There was a problem hiding this comment.
The printed list of “Supported /config language codes” omits yue, even though the PR adds Cantonese support and README suggests using yue. This can mislead users into thinking yue isn’t accepted; update the displayed list (or wording) to include yue (and any other newly-supported aliases you consider canonical).
| # Detect GitHub username from the installed repo before we remove it | ||
| _INSTALL_DIR="$HOME/.local/share/claude-code-voice" | ||
| _REMOTE_URL=$(git -C "$_INSTALL_DIR" remote get-url origin 2>/dev/null || echo "") | ||
| _GITHUB_USER=$(echo "$_REMOTE_URL" | sed -E 's|.*github\.com[:/]([^/]+)/.*|\1|') | ||
| _GITHUB_USER="${_GITHUB_USER:-dr-data}" |
There was a problem hiding this comment.
Same GitHub username extraction issue as in setup.sh: if the repo’s origin URL isn’t a GitHub URL, the sed substitution leaves the URL unchanged and _GITHUB_USER becomes an invalid path segment for raw.githubusercontent.com, breaking the reinstall command printed at the end. Use a match-only extraction and validate the result before falling back to dr-data.
| ## Supported languages | ||
|
|
||
| en, he, es, fr, de, ja, ko, pt, it, ru, zh, ar, hi, tr, nl, pl, uk, el, cs, da, sv, no — and any other language Apple's SFSpeechRecognizer supports. | ||
| en, he, es, fr, de, ja, ko, pt, it, ru, zh, zh-hk, ar, hi, tr, nl, pl, uk, el, cs, da, sv, no — and any other language Apple's SFSpeechRecognizer supports. |
There was a problem hiding this comment.
CLAUDE.md still shows install/uninstall commands using eladcandroid earlier in the file, while this PR updates other docs/scripts to dr-data and/or dynamic URL display. This inconsistency will confuse users following CLAUDE.md; align the commands with the new default username (or update the doc to instruct users to use their fork).
@eladcandroid , you could change back the github username in the install and uninstall script to refer back to your script.
========================================
This pull request adds full support for Cantonese (Hong Kong) speech recognition, improves language code mapping, and updates documentation and install/uninstall scripts to use dynamic GitHub usernames for easier forking. The changes also clarify the distinction between Anthropic and Apple STT language handling, and provide detailed setup instructions for Cantonese users.
Cantonese Language Support:
yue,zh-hk,cantonese,廣東話,粵語,广东话) in the language code mapping inscripts/server.swift, enabling proper recognition and transcription via Apple STT.README.mdandCLAUDE.md) to reflect support for Cantonese, including setup instructions for downloading the Cantonese speech model on macOS. [1] [2]Documentation and User Guidance:
Install/Uninstall Script Improvements:
dr-dataGitHub username by default and added dynamic detection of the GitHub username from the git remote, so forked versions display the correct URLs.