Don't paste dictation that came out in a language you don't use - #1826
Merged
Merged
Conversation
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 doesDictationUserLanguagesread your languages: the Mac's preferred languages, the main language of each enabled keyboard, and a chosen meeting language.STTRouter.transcribekeeps the flagged text in memory asheldBackDictationTextand reports a new empty reason,.otherLanguage. That reason keeps the stopped audio, and the controller offers Paste Anyway. It also logsdictation_output_language_mismatchlocally (model and script only, never text) and sends the analytics eventdictation_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.shpasses (49/49), and so doescheck-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