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

@ -26,12 +26,13 @@ import (
"github.com/spf13/cobra"
"go.uploadedlobster.com/scotty/internal/cli"
"go.uploadedlobster.com/scotty/internal/i18n"
)
var serviceEditCmd = &cobra.Command{
Use: "edit",
Short: "Edit existing service configuration",
Long: `Edit an existing service configuration.`,
Long: `Edit an existing service in the configuration file.`,
Run: func(cmd *cobra.Command, args []string) {
service, err := cli.SelectService()
cobra.CheckErr(err)
@ -48,7 +49,7 @@ var serviceEditCmd = &cobra.Command{
// Save the service config
err = service.Save()
cobra.CheckErr(err)
fmt.Printf("Updated service %v using backend %v\n", service.Name, service.Backend)
fmt.Println(i18n.Tr("Updated service %v using backend %v\n", service.Name, service.Backend))
},
}