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

@ -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,