Skip to content

Commit

Permalink
Merge pull request #79 from canonical/fix-late-i18n-init
Browse files Browse the repository at this point in the history
Fix late i18n init
  • Loading branch information
EduardGomezEscandell authored Mar 30, 2023
2 parents a71b7a2 + c87c1e4 commit 92bc84c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion windows-agent/cmd/ubuntu-pro-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
//go:generate go run ../generate_completion_documentation.go update-doc-cli-ref

func main() {
i18n.InitI18nDomain(common.TEXTDOMAIN)
a := agent.New()
os.Exit(run(a))
}
Expand All @@ -30,7 +31,6 @@ type app interface {
}

func run(a app) int {
i18n.InitI18nDomain(common.TEXTDOMAIN)
defer installSignalHandler(a)()

log.SetFormatter(&log.TextFormatter{
Expand Down
2 changes: 1 addition & 1 deletion wsl-pro-service/cmd/wsl-pro-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
//go:generate go run ../generate_completion_documentation.go update-doc-cli-ref

func main() {
i18n.InitI18nDomain(common.TEXTDOMAIN)
a := service.New()
os.Exit(run(a))
}
Expand All @@ -30,7 +31,6 @@ type app interface {
}

func run(a app) int {
i18n.InitI18nDomain(common.TEXTDOMAIN)
defer installSignalHandler(a)()

log.SetFormatter(&log.TextFormatter{
Expand Down
4 changes: 4 additions & 0 deletions wsl-pro-service/cmd/wsl-pro-service/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func TestRunSignal(t *testing.T) {
}

func TestRun(t *testing.T) {
t.Parallel()

tests := map[string]struct {
runError bool
usageErrorReturn bool
Expand All @@ -78,6 +80,8 @@ func TestRun(t *testing.T) {
for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

a := myApp{
done: make(chan struct{}),
runError: tc.runError,
Expand Down

0 comments on commit 92bc84c

Please sign in to comment.