add migration for transcription.language to general.language

This commit is contained in:
leonardotrapani
2026-02-01 13:44:12 +01:00
parent e46d8abe0d
commit 13b1de4e04
7 changed files with 241 additions and 14 deletions
+13 -3
View File
@@ -10,16 +10,26 @@ import (
// getLanguageOptions returns language options for the dropdown
// if currentModel is provided, languages unsupported by that model will be marked
func getLanguageOptions(currentModel *provider.Model) []huh.Option[string] {
// currentLang is the currently selected language code (empty string for auto-detect)
func getLanguageOptions(currentModel *provider.Model, currentLang string) []huh.Option[string] {
var options []huh.Option[string]
// auto-detect is always first and recommended
options = append(options, huh.NewOption("Auto-detect (Recommended)", ""))
// auto-detect is always first
autoLabel := "Auto-detect"
if currentLang == "" {
autoLabel += " (current)"
}
options = append(options, huh.NewOption(autoLabel, ""))
// add all languages
for _, lang := range language.List() {
label := formatLanguageLabel(lang)
// mark current selection
if lang.Code == currentLang {
label += " (current)"
}
// add warning if model doesn't support this language
if currentModel != nil && !currentModel.SupportsLanguage(lang.Code) {
label += " (not supported by current model)"