Skip to content

Add zh-HK Cantonese support and update installation instructions#1

Open
dr-data wants to merge 11 commits into
eladcandroid:mainfrom
dr-data:main
Open

Add zh-HK Cantonese support and update installation instructions#1
dr-data wants to merge 11 commits into
eladcandroid:mainfrom
dr-data:main

Conversation

@dr-data

@dr-data dr-data commented Apr 9, 2026

Copy link
Copy Markdown

@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:

  • Added support for Cantonese (yue, zh-hk, cantonese, 廣東話, 粵語, 广东话) in the language code mapping in scripts/server.swift, enabling proper recognition and transcription via Apple STT.
  • Updated documentation (README.md and CLAUDE.md) to reflect support for Cantonese, including setup instructions for downloading the Cantonese speech model on macOS. [1] [2]

Documentation and User Guidance:

  • Clarified the distinction between Claude-native languages (proxied to Anthropic) and Apple STT languages (local transcription) in the documentation, and improved the language support table to show Cantonese as a separate entry. [1] [2]
  • Provided a more detailed diagram and explanation of the voice server's routing logic.

Install/Uninstall Script Improvements:

  • Updated all install/uninstall script URLs to use the dr-data GitHub username by default and added dynamic detection of the GitHub username from the git remote, so forked versions display the correct URLs.
  • Updated the list of supported language codes shown at install time to include Cantonese and other new codes.

Copilot AI and others added 11 commits April 9, 2026 04:16
Add `zh-hk` Cantonese routing to Apple STT
…-instructions

Update README install source, clarify token/local STT behavior, and simplify architecture diagram
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>
Copilot AI review requested due to automatic review settings April 9, 2026 15:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh to default to dr-data and 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.

Comment thread setup.sh
Comment on lines +19 to +22
# 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}"

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread setup.sh
Comment on lines +124 to +126
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"

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment thread uninstall.sh
Comment on lines +7 to +11
# 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}"

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread CLAUDE.md
Comment on lines 21 to +23
## 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.

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
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.

3 participants