From 0ffbf1935c9d091cce22a5583275ac0902f7a693 Mon Sep 17 00:00:00 2001 From: Ariver <shanghai3168@gmail.com> Date: Thu, 02 Jul 2026 03:04:51 +0800 Subject: [PATCH] Add Cantonese language model support --- CODEGRAPH.md | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) diff --git a/CODEGRAPH.md b/CODEGRAPH.md index 3d3b984..359f71b 100644 --- a/CODEGRAPH.md +++ b/CODEGRAPH.md @@ -3,7 +3,7 @@ ## Project - Product: Wails v3 / Go desktop dictation app. -- Current branch purpose: Windows technical preview based on `v2.1.38-build20260629.2014-diagnostic`. +- Current branch purpose: Round 6 Cantonese language version real-user test package based on `v2.2.0-build20260702.0303`. - Protected macOS behavior: existing macOS App Store / local DMG build lines are not changed by this branch. ## Core Entrypoints @@ -11,6 +11,17 @@ - `privatevoice.src/main.go`: process startup, data migration, logger, single-instance guard. - `privatevoice.src/app.go`: Wails app wiring, settings window, tray, recorder, hotkey loop, ASR init, paste orchestration. - `privatevoice.src/embed.go`: embeds frontend assets and app/tray icons. + +## Language And Model Registry + +- `privatevoice.src/internal/model/profile.go`: model and language IDs, model profile shape, install status types. +- `privatevoice.src/internal/model/registry.go`: language profile order, model profiles, language profiles, and normalization. +- `privatevoice.src/internal/modelselection/selection.go`: resolves current language and model, including manual-model fallback. +- Round 6 Cantonese path: + - Language ID: `yue-HK`, displayed as `粤语`. + - Default model: `sensevoice-yue-2025-09-09`. + - Backend: SenseVoice with `LanguageParam="yue"`. + - The Cantonese language profile intentionally has no upgrade models, so Qwen3-ASR and X-ASR are not shown as Cantonese-specific options. ## Platform Modules @@ -26,6 +37,8 @@ - ASR engine: - macOS: `privatevoice.src/internal/engine/engine_darwin.go` - Windows: `privatevoice.src/internal/engine/engine_windows.go` + - Linux: `privatevoice.src/internal/engine/engine_linux.go` + - SenseVoice profiles may set `Profile.LanguageParam`; Cantonese uses `yue`. - Overlay: - macOS: `privatevoice.src/internal/overlay/overlay_darwin.go` - Windows: `privatevoice.src/internal/overlay/overlay_windows.go` @@ -47,6 +60,17 @@ - `QA-WINDOWS-PREVIEW.ps1` - `README-WINDOWS-PREVIEW.txt` +## macOS Local Package Scope + +- Local DMG script: `privatevoice.src/scripts/build-local-macos.sh`. +- Universal DMG script: `privatevoice.src/scripts/build-local-macos-universal.sh`. +- Local macOS package set for this branch: + - `arm64` DMG for Apple Silicon. + - `x86_64` DMG for Intel Mac. + - `universal` DMG for Intel + Apple Silicon. +- Mainline macOS local packages keep `LSMinimumSystemVersion=14.0` and the default Qwen3-capable dependency line. +- Monterey-compatible packages remain a separate build line through `privatevoice.src/scripts/build-local-macos-monterey.sh`. + ## Standard Verification Commands Run from `privatevoice.src`: @@ -56,6 +80,9 @@ go test ./... GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go test -exec=/usr/bin/true ./... ./scripts/build-windows-preview.sh +./scripts/build-local-macos.sh arm64 +./scripts/build-local-macos.sh x86_64 +./scripts/build-local-macos-universal.sh ./scripts/verify-windows-qa-evidence.sh /path/to/qa-evidence-YYYYMMDD-HHMMSS.zip ``` -- Gitblit v1.9.3