Skip to content

Fix live spell check using the English dictionary for other languages#12289

Open
muaz978 wants to merge 1 commit into
SubtitleEdit:mainfrom
muaz978:fix/live-spell-check-language-guard
Open

Fix live spell check using the English dictionary for other languages#12289
muaz978 wants to merge 1 commit into
SubtitleEdit:mainfrom
muaz978:fix/live-spell-check-language-guard

Conversation

@muaz978

@muaz978 muaz978 commented Jul 8, 2026

Copy link
Copy Markdown

Problem

With live spell check enabled and only the English dictionary installed, an Arabic speech to text transcription came back with every single word underlined in red, in the subtitle grid and in the text box.

Cause

Live spell check picks its dictionary by auto detecting the subtitle's language, but the detection helper used here falls back to English when the subtitle is empty or undetectable. The setup runs at startup before any file is loaded, so the spell checker was armed with the English dictionary against an empty subtitle. Content that arrives without a file open, such as a speech to text transcription or a video OCR result, never re-evaluated that choice, so Arabic text was spell checked against the English dictionary.

Fix

Two small changes in MainViewModel:

  1. SetupLiveSpellCheck now uses AutoDetectGoogleLanguageOrNull, which returns null instead of the English fallback. An empty or undetectable subtitle disables live spell check instead of arming it with the wrong dictionary. Opening a file re-evaluates as before.
  2. The speech to text and video OCR result paths call SetupLiveSpellCheck() after inserting their content, the same way opening a file does.

A side effect worth noting: a fresh English transcription now gets live spell check enabled correctly, which previously only happened by accident of the English fallback.

Testing

Verified on macOS (Apple Silicon), all three directions:

  • Arabic transcription (MLX Whisper): no false underlines anywhere.
  • Opening an English subtitle file: live spell check works as before, real typos underlined.
  • English transcription: live spell check now activates on the result.

Live spell check picks its dictionary by auto detecting the subtitle's
language, but the detection helper falls back to English when the subtitle is
empty or the language cannot be determined. At startup the setup runs before
any file is loaded, so with only the English dictionary installed the spell
checker was armed with English. Content that arrives without a file open,
such as a speech to text transcription or a video OCR result, never
re-evaluated the choice, so an Arabic transcription was spell checked against
the English dictionary and every single word was underlined as misspelled.

The setup now uses the detection variant that returns null instead of the
English fallback (an empty or undetectable subtitle disables live spell check
instead of arming it), and the transcription and video OCR result paths
re-evaluate the dictionary after inserting their content, the same way
opening a file does. This also means a fresh English transcription now gets
live spell check enabled, which previously only happened by accident.
@muaz978

muaz978 commented Jul 8, 2026

Copy link
Copy Markdown
Author
Screenshot 2026-07-09 at 1 20 13 AM Screenshot 2026-07-09 at 1 20 26 AM

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.

1 participant