chore: make the application more internationalized

This commit is contained in:
2025-02-27 11:18:13 +03:00
parent 47a9b9a96c
commit 4e6e1f524a
10 changed files with 320 additions and 15 deletions

View File

@ -31,6 +31,7 @@ import (
"github.com/mattn/go-isatty"
"github.com/urfave/cli/v2"
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils"
"gitea.plemya-x.ru/Plemya-x/ALR/internal/config"
"gitea.plemya-x.ru/Plemya-x/ALR/internal/translations"
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
@ -118,6 +119,11 @@ func main() {
ctx, cancel := signal.NotifyContext(ctx, syscall.SIGINT, syscall.SIGTERM)
defer cancel()
// Make the application more internationalized
cli.AppHelpTemplate = cliutils.GetAppCliTemplate()
cli.CommandHelpTemplate = cliutils.GetCommandHelpTemplate()
cli.HelpFlag.(*cli.BoolFlag).Usage = gotext.Get("Show help")
err := app.RunContext(ctx, os.Args)
if err != nil {
slog.Error(gotext.Get("Error while running app"), "err", err)