Skip to content

Don't paste dictation that came out in a language you don't use - #1826

Merged
r3dbars merged 3 commits into
mainfrom
claude/dictation-wrong-language-top6ob
Sep 24, 2026
Merged

r3dbars merged 3 commits into
mainfrom
claude/dictation-wrong-language-top6ob

Conversation

@r3dbars

@r3dbars r3dbars commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Requested by Justin · project thread

Before: an English dictation on the 1.1.63 test build pasted Russian text ("Перед учителем."). Parakeet V3, Parakeet Ultra and Whisper all guess the language on their own for dictation, and on a short or unclear clip they can guess wrong.

After: if the finished text is nearly all in a writing system none of your languages use, it isn't pasted right away. The pill says "This came out in a language your Mac isn't set up for, so it wasn't pasted. If it's right, choose Paste Anyway." and has a Paste Anyway button. The audio is kept.

None of these engines take a language hint for dictation (FluidAudio 0.15.4's Parakeet has no language input), so this checks the text after it comes back.

How: DictationLanguageScriptPolicy (Foundation-only, fast-tested) flags text only when one non-Latin script is 80% or more of at least 4 classified letters. So "Call Олег" or "Ask 王先生" still pastes. Latin is always accepted, and scripts it can't classify are never flagged. Only when text is flagged does DictationUserLanguages read your languages: the Mac's preferred languages, the main language of each enabled keyboard, and a chosen meeting language. STTRouter.transcribe keeps the flagged text in memory as heldBackDictationText and reports a new empty reason, .otherLanguage. That reason keeps the stopped audio, and the controller offers Paste Anyway. It also logs dictation_output_language_mismatch locally (model and script only, never text) and sends the analytics event dictation_other_language, which is registered in the psv file and the privacy doc.

The check runs for every model. English-only V2 and Apple Speech just never trigger it. A wrong guess between two Latin-script languages (Polish for English) isn't caught.

Checks: bash scripts/dev/linux-checks.sh passes (49/49), and so does check-source-pins.py --changed-only. CI was green on the first push (25644df). This push (b3351b6) addresses deep review B1, S1, S2 and M1.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YRzXu6P2wtvTdRDzuR41Qh

Parakeet V3, Parakeet Ultra and Whisper pick the language themselves,
and a short English dictation came out as Russian ("Перед учителем.")
on the 1.1.63 test build. None of them take a language hint for
dictation, so check the finished text: when it's mostly in a script
none of the person's languages use (Mac preferred languages, enabled
keyboards, a chosen meeting language), paste nothing and say so.
Latin is always accepted and unknown scripts are never rejected.

New empty reason .otherLanguage with its own analytics event
dictation_other_language.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YRzXu6P2wtvTdRDzuR41Qh
@r3dbars r3dbars self-assigned this Sep 24, 2026
Deep review (#1826): a held-back dictation lost both text and audio, and
short English with a foreign-script name ('Call Олег') was held back.

- .otherLanguage no longer discards the stopped audio; the message offers
  Paste Anyway with the held text (memory only, never logged).
- Flag only when one non-Latin script is 80%+ of 4+ letters; no ties.
- Read keyboard languages only when the text is flagged.
- Map bs, cnr, ckb, pnb. Copy no longer suggests switching models.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YRzXu6P2wtvTdRDzuR41Qh
Re-check of #1826: a Paste Anyway take was missing from dictation
history and Paste Last Dictation, and its kept WAV lingered. Route it
through the normal save path (which also cleans up this take's audio),
and don't let its result replace the pill of a take started meanwhile.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YRzXu6P2wtvTdRDzuR41Qh
@r3dbars
r3dbars marked this pull request as ready for review September 24, 2026 11:01
@r3dbars
r3dbars merged commit 97c2ba2 into main Sep 24, 2026
8 checks passed
@r3dbars
r3dbars deleted the claude/dictation-wrong-language-top6ob branch September 24, 2026 11:01
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.

2 participants