Mark user interface strings

For now exclude command help, as cobra itself is not localizable yet.
This commit is contained in:
Philipp Wolfer 2023-12-09 16:43:14 +01:00
parent 511b71b909
commit d6ca8d33f7
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
27 changed files with 1005 additions and 95 deletions

View file

@ -19,6 +19,7 @@ import (
"fmt"
"github.com/manifoldco/promptui"
"go.uploadedlobster.com/scotty/internal/i18n"
"go.uploadedlobster.com/scotty/internal/models"
)
@ -63,10 +64,12 @@ func PromptBool(opt models.BackendOption) (bool, error) {
}
func PromptYesNo(label string) (bool, error) {
yes := i18n.Tr("Yes")
no := i18n.Tr("No")
sel := promptui.Select{
Label: label,
Items: []string{"Yes", "No"},
Items: []string{yes, no},
}
_, val, err := sel.Run()
return val == "Yes", err
return val == yes, err
}