Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(mobile): choose the language for iPhone voice input #17692

Closedroprgm(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/17692/headopened View on GitHub

Problem

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 beforeSettings afterVoice input
Settings Interface section with Appearance and KeyboardSettings Interface section with a new Voice input rowVoice input language list with Automatic selected

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

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/81dd29ef29630e8d355dba3133dce3abb42fd00b/packages/client-runtime/src/voice-input/controller.ts#L102

      With locale set to es-ES, inserting también at the end of café produces café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

    3. 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
      Adjust the Minimum Blocking Severity for this repo — including turning it Off — in [Settings](https://app.macroscope.com/pingdotgg/settings#Repos). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. roprgm(GitHub profile, opens in a new tab)commented

      Fixed in 6fc58b0: both boundary checks use Unicode letter and number classes, with tests for café + también and for inserting before an accented word.

    5. Sorry, I'm unable to act on this request because you do not have permissions within this repository.

    6. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →Review in Change Stack →

      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.tsx
      • apps/mobile/src/features/settings/SettingsRouteScreen.tsx
      • apps/mobile/src/features/settings/SettingsVoiceInputRouteScreen.tsx
      • apps/mobile/src/features/settings/components/settings-sheet-targets.ts
      • apps/mobile/src/features/voice-input/VoiceInputProvider.tsx
      • apps/mobile/src/native/voiceTranscription.ios.test.ts
      • apps/mobile/src/native/voiceTranscription.ios.ts
      • apps/mobile/src/native/voiceTranscription.ts
      • apps/mobile/src/persistence/mobile-preferences.ts
      • docs/user/composer.md
      • packages/client-runtime/src/voice-input/controller.test.ts
      • packages/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.md
      Preferences retain voiceInputLanguage when 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.ts
      VoiceInputProvider reads 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 returns null.
      Apply locale-aware transcript spacing
      packages/client-runtime/src/voice-input/controller.ts, packages/client-runtime/src/voice-input/controller.test.ts
      Transcript 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 preparation

      Suggested reviewers: juliusmarminge



      Merge Risk: ⚪ Minimal · up to 891eb

      The 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 891eb

      The 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 | Passed 4
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Title checkPassedThe title is concise, uses the conventional commit format, and clearly describes the primary change: selecting the language for iPhone voice input.
      Description checkPassedThe 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.
    7. juliusmarminge added labelsmacroscope-review

    8. Note

      Written by gpt-6.1-sol on behalf of Maria

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

    9. maria-rcks closed this

Sign in to join this conversation.