feat(mobile): choose the language for iPhone voice input #17692
main fromrefs/pull/17692/head·opened View on GitHubProblem#
People who dictate in a language other than the app's cannot choose the transcription language, for example with the phone in English and dictation in Spanish. iPhone voice input uses the app's locale, which is English for everyone because the app ships only in English, so other languages come out as unrelated English words. #12743 shows one case.
Change#
Settings → Voice input adds an explicit language override for on-device transcription. Automatic is the default and keeps today's locale selection.
Transcript spacing was gated on an English locale, so a transcript in a chosen language would stick to the previous word. Spacing now applies to every locale except languages written without spaces (Japanese, Chinese, Thai, and similar), and accented letters count as word characters. It follows the resolved locale, so it also applies to Automatic; with today's English app locale that path behaves as before.
Scope and approval#
Configuration of an existing capability: on-device voice input already exists, and this option only chooses its transcription language. Recording and the default locale selection are unchanged. It does not fix the default for #12743; #13312 and discussion #13313 address that by following the device's preferred languages, and this override complements it. Both touch the spacing gate, so whichever lands second rebases. The cloud transcription idea in #15422 is outside this PR.
Verification#
vp test run packages/client-runtime/src/voice-input/controller.test.ts apps/mobile/src/native/voiceTranscription.ios.test.ts(35 tests pass): the chosen language reaches Apple's transcriber; Spanish transcripts get spacing, including after and before accented letters; English and Japanese behave as before.- Physical iPhone 17 Pro (iOS 26.7.1), Release build, phone in English: with Spanish chosen, Spanish dictation is transcribed in Spanish.
- Not checked on device: languages other than Spanish and English, and resetting to Automatic after a choice. Android is unaffected: the setting is iPhone only, like voice input.
| Settings before | Settings after | Voice input |
|---|---|---|
Made with Claude Opus 5.5 in Claude Code, running in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
🟡 Medium
With
localeset toes-ES, insertingtambiénat the end ofcaféproducescafétambién, and insertion before a word beginning with an accented or non-Latin letter also omits the separator. The boundary checks use ASCII-only letter and digit classes, so they miss those characters; use Unicode-aware letter and number classes for both checks.✅ Resolved in 891eb9eadc6a93fb6ca1deff1543c720ef344919
Approvability#
Verdict: Not approved
Macroscope's review found this PR not approvable — This PR adds a new iOS voice-language capability with a settings screen, persisted preference, native transcription integration, and changed non-English insertion behavior, exceeding the bounded additive scope for automatic approval. An unresolved Medium finding also identifies missing separators around accented or non-Latin text.
Not approved because:
- 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity
Fixed in 6fc58b0: both boundary checks use Unicode letter and number classes, with tests for
café+tambiénand for inserting before an accented word.Sorry, I'm unable to act on this request because you do not have permissions within this repository.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
-
⚙️ Run configuration
-
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3f25cce0-4bce-4784-af06-68284639d0ed
-
📥 Commits
-
-
Reviewing files that changed from the base of the PR and between ed4ea1083d477b67304f50d5691ba5fc2b9496cd and 891eb9eadc6a93fb6ca1deff1543c720ef344919.
-
📒 Files selected for processing (12)
-
-
apps/mobile/src/Stack.tsxapps/mobile/src/features/settings/SettingsRouteScreen.tsxapps/mobile/src/features/settings/SettingsVoiceInputRouteScreen.tsxapps/mobile/src/features/settings/components/settings-sheet-targets.tsapps/mobile/src/features/voice-input/VoiceInputProvider.tsxapps/mobile/src/native/voiceTranscription.ios.test.tsapps/mobile/src/native/voiceTranscription.ios.tsapps/mobile/src/native/voiceTranscription.tsapps/mobile/src/persistence/mobile-preferences.tsdocs/user/composer.mdpackages/client-runtime/src/voice-input/controller.test.tspackages/client-runtime/src/voice-input/controller.ts
-
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
-
📝 Walkthrough
-
📝 Walkthrough
-
Walkthrough#
The mobile app adds an iOS setting for voice-input language and uses the saved locale when creating a local transcriber. Transcript insertion spacing now supports Unicode letters and numbers and applies to more locales.
Changes#
Voice Input Locale
Layer / File(s) Summary Store and expose the voice-input language
apps/mobile/src/persistence/mobile-preferences.ts,apps/mobile/src/features/settings/components/settings-sheet-targets.ts,apps/mobile/src/features/settings/SettingsVoiceInputRouteScreen.tsx,apps/mobile/src/features/settings/SettingsRouteScreen.tsx,apps/mobile/src/Stack.tsx,docs/user/composer.mdPreferences retain voiceInputLanguagewhen its value is a string. An iOS settings screen offers Automatic and 11 locale choices, and the settings navigator registers the screen. The composer guide describes how to select a dictation language.Pass the selected locale to transcription
apps/mobile/src/features/voice-input/VoiceInputProvider.tsx,apps/mobile/src/native/voiceTranscription.ios.ts,apps/mobile/src/native/voiceTranscription.ts,apps/mobile/src/native/voiceTranscription.ios.test.tsVoiceInputProviderreads the saved language and supplies it to the transcriber factory. The iOS transcriber uses the supplied language instead of the device locale. The non-iOS function accepts the optional argument but still returnsnull.Apply locale-aware transcript spacing
packages/client-runtime/src/voice-input/controller.ts,packages/client-runtime/src/voice-input/controller.test.tsTranscript insertion uses Unicode letter and number boundary checks. It adds spacing for locales except those with the listed no-word-spacing prefixes. Tests cover Spanish transcript spacing. Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Sequence Diagram(s)#
sequenceDiagram participant Settings as SettingsVoiceInputRouteScreen participant Preferences as mobilePreferencesAtom participant Provider as VoiceInputProvider participant Transcriber as getLocalVoiceTranscriber Settings->>Preferences: Save selected language Provider->>Preferences: Read saved language Provider->>Transcriber: Request transcriber with language Transcriber->>Transcriber: Select locale for preparationSuggested reviewers:
juliusmarminge
-
Merge Risk: ⚪ Minimal · up to
891ebThe identified concerns do not block language selection or transcript insertion. This change is mergeable after normal checks.
Security Architecture Review
Security architecture risk: 🔵 Low · up to
891ebThe change remains within the existing device-local dictation flow and preserves microphone permission and draft ownership checks. No material security regression was demonstrated. Device-specific language preparation remains only partially verified.
Retained concerns No architecture-level concerns identified.
-
Security review details
-
-
Security Blast Radius
- inferred — The demonstrated exposure is the current app installation's language preference, recording preparation, and owned composer draft. The new settings screen neither consumes an externally supplied locale nor invokes recording when opened.
Trust Boundaries and Controls
- observed — Persisted locale values receive string-type validation, not enumeration validation. The iOS wrapper checks native availability and handles unsupported preparation before recording begins; microphone permission remains required. The non-iOS implementation still returns no transcriber.
Resilience and Maintainability Implications
- observed — The new field uses existing serialized read-modify-write persistence and per-field optimistic versions. Failed saves roll back their own optimistic values without removing newer updates.
- observed — Existing session and operation tokens serialize recording and native transcription. Cancellation invalidates pending commits, and terminal or discard paths release audio resources and attempt deletion of owned recording files. These controls are unchanged by the locale-selection change.
-
-
Pre-merge checks |
4-
✅ Passed checks (4 passed)
-
Check name Status Explanation Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Title check The title is concise, uses the conventional commit format, and clearly describes the primary change: selecting the language for iPhone voice input. Description check The description includes all required sections. It explains the problem, change, scope and approval basis, focused verification results, untested cases, UI evidence, and the agent attribution.
-
✨ Finishing Touches
-
-
🧪 Generate unit tests (beta)
-
-
- Create a new PR
-
-
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.-
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge added labelsmacroscope-review
Note
Written by
gpt-6.1-solon behalf of MariaThanks for showing the language mismatch in iPhone dictation. This PR adds a language setting while leaving the reported Automatic locale defect unchanged. Right now we are only taking focused bug fixes from outside contributors under our limited review capacity: https://github.com/pingdotgg/t3code/blob/main/CONTRIBUTING.md#read-this-first. Please keep the locale failure in the existing issue and request reconsideration with a focused default-language fix, or discuss the override in Ideas for a future pass.
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed