add language menu item to tui configuration

This commit is contained in:
leonardotrapani
2026-02-01 13:19:21 +01:00
parent 1f6fce6941
commit e005184303
5 changed files with 39 additions and 1 deletions
+11
View File
@@ -6,6 +6,7 @@ import (
"github.com/charmbracelet/huh"
"github.com/leonardotrapani/hyprvoice/internal/config"
"github.com/leonardotrapani/hyprvoice/internal/language"
)
// formatProvidersLabel formats the providers menu option
@@ -13,6 +14,16 @@ func formatProvidersLabel(cfg *config.Config) string {
return "Providers"
}
// formatLanguageMenuLabel formats the language menu option showing current setting
func formatLanguageMenuLabel(cfg *config.Config) string {
langCode := cfg.General.Language
if langCode == "" {
return "Language (Auto-detect)"
}
lang := language.FromCode(langCode)
return fmt.Sprintf("Language (%s)", lang.Name)
}
// formatTranscriptionLabel formats the transcription menu option
func formatTranscriptionLabel(cfg *config.Config) string {
return "Transcription"