mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-29 13:27:03 +02:00
Mark user interface strings
For now exclude command help, as cobra itself is not localizable yet.
This commit is contained in:
parent
511b71b909
commit
d6ca8d33f7
27 changed files with 1005 additions and 95 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue