add language menu item to tui configuration
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user