Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more
Address language selection review feedback
Wallner Ádám0a2a82e1bed4
diff --git a/Sources/Fluid/Persistence/SettingsStore.swift b/Sources/Fluid/Persistence/SettingsStore.swiftindex 48046d36..ac94d521 100644--- a/Sources/Fluid/Persistence/SettingsStore.swift+++ b/Sources/Fluid/Persistence/SettingsStore.swift@@ -3325,7 +3325,9 @@ final class SettingsStore: ObservableObject {self.privateAIContextTokenLimit = privateAIContextTokenLimit}self.selectedSpeechModel = payload.selectedSpeechModel- self.selectedWhisperLanguageCode = payload.selectedWhisperLanguageCode+ if let selectedWhisperLanguageCode = payload.selectedWhisperLanguageCode {+ self.selectedWhisperLanguageCode = selectedWhisperLanguageCode+ }self.selectedCohereLanguage = payload.selectedCohereLanguageif let selectedNemotronLanguage = payload.selectedNemotronLanguage {self.selectedNemotronLanguage = selectedNemotronLanguagediff --git a/Sources/Fluid/Persistence/VoiceEngineLanguageCatalog.swift b/Sources/Fluid/Persistence/VoiceEngineLanguageCatalog.swiftindex 317f1bdb..7d13f4b7 100644--- a/Sources/Fluid/Persistence/VoiceEngineLanguageCatalog.swift+++ b/Sources/Fluid/Persistence/VoiceEngineLanguageCatalog.swift@@ -361,7 +361,7 @@ enum VoiceEngineLanguageCatalog {private static let whisperLanguageCodeMap: [String: String] = {var languageMap: [String: String] = [:]for language in Self.languageDefinitions {- let whisperCode = language.id == "he" ? "iw" : language.id+ let whisperCode = language.idguard Self.whisperSupportedLanguageCodes.contains(whisperCode) else { continue }languageMap[language.id] = whisperCode}@@ -372,7 +372,7 @@ enum VoiceEngineLanguageCatalog {"af", "am", "ar", "as", "az", "ba", "be", "bg", "bn", "bo","br", "bs", "ca", "cs", "cy", "da", "de", "el", "en", "es","et", "eu", "fa", "fi", "fo", "fr", "gl", "gu", "ha", "haw",- "hi", "hr", "ht", "hu", "hy", "id", "is", "it", "iw", "ja",+ "he", "hi", "hr", "ht", "hu", "hy", "id", "is", "it", "ja","jw", "ka", "kk", "km", "kn", "ko", "la", "lb", "ln", "lo","lt", "lv", "mg", "mi", "mk", "ml", "mn", "mr", "ms", "mt","my", "ne", "nl", "nn", "no", "oc", "pa", "pl", "ps", "pt",diff --git a/Sources/Fluid/Services/WhisperProvider.swift b/Sources/Fluid/Services/WhisperProvider.swiftindex 0af30138..feecfe6d 100644--- a/Sources/Fluid/Services/WhisperProvider.swift+++ b/Sources/Fluid/Services/WhisperProvider.swift@@ -322,7 +322,7 @@ final class WhisperProvider: TranscriptionProvider {return ASRTranscriptionResult(text: fullText, confidence: 1.0)}- static func runOptions(languageCode: String? = SettingsStore.shared.selectedWhisperLanguageCode) -> RunOptions {+ static func runOptions(languageCode: String?) -> RunOptions {RunOptions(timestamps: .segment, language: languageCode)}diff --git a/Tests/FluidDictationIntegrationTests/WhisperLanguageSelectionTests.swift b/Tests/FluidDictationIntegrationTests/WhisperLanguageSelectionTests.swiftindex f281fdd1..d9ac75cd 100644--- a/Tests/FluidDictationIntegrationTests/WhisperLanguageSelectionTests.swift+++ b/Tests/FluidDictationIntegrationTests/WhisperLanguageSelectionTests.swift@@ -7,6 +7,11 @@ final class WhisperLanguageSelectionTests: XCTestCase {XCTAssertEqual(VoiceEngineLanguageCatalog.whisperLanguage(forCode: "hu")?.displayName, "Hungarian")}+ func testHebrewUsesWhisperLanguageCode() {+ XCTAssertEqual(VoiceEngineLanguageCatalog.whisperLanguageCode(for: "he"), "he")+ XCTAssertEqual(VoiceEngineLanguageCatalog.whisperLanguage(forCode: "he")?.displayName, "Hebrew")+ }+func testWhisperRunOptionsUseSelectedLanguage() {XCTAssertEqual(WhisperProvider.runOptions(languageCode: "hu").language, "hu")}