From 8a476b326136f5c03790fa168686848884c8cd5a Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 14 Nov 2019 09:27:05 +0100 Subject: l18n: add localization support Revise the messages to make them localizable. Note: The log messages are not marked for localization. Probably, we want to keep log files in English for easier global troubleshooting. Having a user run `go generate` requires a valid and up-to-date Go environment. Rather than instructing users how to setup the environment correctly, the `go generate` was integrated into build.bat. This reuses the Go building environment downloaded and prepared by build.bat to provide controllable and consistent result. Use `make generate` on Linux. As the zgotext.go output varies for GOARCH=386 and amd64, one had to be chosen to provide stable output. The former is the first one to build in build.bat. Signed-off-by: Simon Rozman --- ui/raise.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ui/raise.go') diff --git a/ui/raise.go b/ui/raise.go index 42509994..0eac828a 100644 --- a/ui/raise.go +++ b/ui/raise.go @@ -6,12 +6,13 @@ package ui import ( - "fmt" "os" "runtime" "github.com/lxn/win" "golang.org/x/sys/windows" + + "golang.zx2c4.com/wireguard/windows/l18n" ) func raise(hwnd win.HWND) { @@ -66,7 +67,7 @@ func WaitForRaiseUIThenQuit() { return 0 }, 0, 0, win.WINEVENT_SKIPOWNPROCESS|win.WINEVENT_OUTOFCONTEXT) if err != nil { - showErrorCustom(nil, "WireGuard Detection Error", fmt.Sprintf("Unable to wait for WireGuard window to appear: %v", err)) + showErrorCustom(nil, l18n.Sprintf("WireGuard Detection Error"), l18n.Sprintf("Unable to wait for WireGuard window to appear: %v", err)) } for { var msg win.MSG -- cgit v1.2.3-59-g8ed1b