Make the "English" Language setting actually translate - #57
Merged
Conversation
The Language picker's "English — Whisper translate to English" never translated:
the engine passed `-l en` (telling whisper the SOURCE is English) and never the
`--translate` flag. Translation only "worked" before because the spoken command
("переведи на английский") leaked into the LLM, which executed it — and the prior
PR (#56) correctly stopped that leak, exposing that there was no real translation
path without the LLM.
Verified on synthesized Russian audio with the bundled whisper-cli:
-l auto -> "Всем привет, как ваша дела сегодня!" (Russian)
-l auto --translate -> "Hello everyone, how are you doing today?" (English)
- New WhisperTask.resolve(languageSetting:) (OpenWhispCore, pure): maps "en" ->
(language: auto, translate: true); everything else -> (that language, no
translate). whisper's --translate always targets English and needs the source
auto-detected, so "en" must NOT be sent as the source language.
- WhisperEngine CLI path now appends --translate; server path sends translate=true
+ language=auto. Both via the shared resolver.
- Tests: +4 WhisperTaskTests. 177 -> 181.
This gives translation WITHOUT the LLM (whisper-native), per the chosen behavior:
translate via the persistent Language setting, not via a voice command.
swift test 181/181; ./build.sh clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Diagnosed while chasing the «переведи на английский» report. After #56 stopped the voice-command from leaking into the LLM, dictating Russian with the Language set to English produced Russian output — because the "English — Whisper translate to English" setting never actually translated.
Root cause (verified on real audio)
WhisperEnginepassed-l en(which tells whisper the source is English) and never the--translateflag. Translation only ever "worked" by accident — the spoken command leaked into the LLM, which executed it. With that leak fixed, there was no whisper-native translation path at all.Proven with the bundled
whisper-clion synthesized Russian speech:Changes
WhisperTask.resolve(languageSetting:)(OpenWhispCore, pure):"en"→(language: auto, translate: true); any other value →(that language, translate: false).--translatealways targets English and needs the source auto-detected, so "en" must not be sent as the source language.WhisperEngine: CLI path appends--translate; server path sendstranslate=true+language=auto. Both go through the shared resolver.WhisperTaskTests. 177 → 181.Gives translation without the LLM (whisper-native) — matching the chosen model: translate via the persistent Language setting, not a voice command.
swift test181/181 ·./build.shclean.🤖 Generated with Claude Code