diff --git a/src/lib/stores/settings.svelte.ts b/src/lib/stores/settings.svelte.ts index cbb7d4c..a3809f4 100644 --- a/src/lib/stores/settings.svelte.ts +++ b/src/lib/stores/settings.svelte.ts @@ -14,6 +14,7 @@ import { type HardwareStatus, type LlmStatus, type ModelInfo, + type LanguageOption, type PrivacySelfCheck, type McpStatus, type McpAccessEntry, @@ -27,6 +28,7 @@ const DEFAULT_SETTINGS: AppSettings = { llm_model: "llama3", preferred_backend: "auto", whisper_model: "base.en-q5_1", + whisper_language: null, // auto-detect by default (T8.7, FR-TRX-4) low_overhead: false, default_record: false, // recording OFF by default (ADR-0009) consent_acknowledged: false, @@ -58,6 +60,8 @@ class SettingsStore { // Hardware + model management (Phase 3, T3.6/T3.7). hardware = $state(null); models = $state([]); + // Transcription language catalog for the Settings dropdown (T8.7, FR-TRX-4). + languages = $state([]); audioDevices = $state([]); inputDevices = $state([]); downloadProgress = $state>({}); @@ -96,6 +100,7 @@ class SettingsStore { await this.loadAudioDevices(); await this.loadInputDevices(); await this.loadModels(); + await this.loadLanguages(); await this.loadPrivacy(); await this.loadLlmStatus(); await this.loadMcpStatus(); @@ -193,6 +198,21 @@ class SettingsStore { } } + async loadLanguages() { + try { + this.languages = await api.listWhisperLanguages(); + } catch { + this.languages = []; + } + } + + /** `null` = auto-detect (T8.7, FR-TRX-4). Only meaningful when the active + * model is multilingual — the Settings UI disables/hides this control + * otherwise, and the backend forces "en" regardless if it's set anyway. */ + async setWhisperLanguage(code: string | null) { + await this.patch({ whisper_language: code }); + } + async loadPrivacy() { try { this.privacy = await api.privacySelfCheck();