mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +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
|
@ -23,16 +23,17 @@ import (
|
|||
"github.com/manifoldco/promptui"
|
||||
"go.uploadedlobster.com/scotty/internal/backends"
|
||||
"go.uploadedlobster.com/scotty/internal/config"
|
||||
"go.uploadedlobster.com/scotty/internal/i18n"
|
||||
)
|
||||
|
||||
func SelectService() (config.ServiceConfig, error) {
|
||||
services := config.AllServicesAsList()
|
||||
if len(services) == 0 {
|
||||
err := errors.New("no existing service configurations")
|
||||
err := errors.New(i18n.Tr("no existing service configurations"))
|
||||
return config.ServiceConfig{}, err
|
||||
}
|
||||
sel := promptui.Select{
|
||||
Label: "Service",
|
||||
Label: i18n.Tr("Service"),
|
||||
Items: services,
|
||||
Size: 10,
|
||||
}
|
||||
|
@ -49,7 +50,7 @@ func SelectBackend(selected string) (string, error) {
|
|||
return b.Name == selected
|
||||
})
|
||||
sel := promptui.Select{
|
||||
Label: "Backend",
|
||||
Label: i18n.Tr("Backend"),
|
||||
Items: backendList,
|
||||
CursorPos: i,
|
||||
Size: 10,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue