aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/managewindow.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-11-14 09:27:05 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-03-15 14:49:27 -0600
commit8a476b326136f5c03790fa168686848884c8cd5a (patch)
tree3fac4f2940c3012734a4147ef627e2b52a27a859 /ui/managewindow.go
parentmanager: chdir into unelevated profile before execing (diff)
downloadwireguard-windows-8a476b326136f5c03790fa168686848884c8cd5a.tar.xz
wireguard-windows-8a476b326136f5c03790fa168686848884c8cd5a.zip
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 <simon@rozman.si>
Diffstat (limited to 'ui/managewindow.go')
-rw-r--r--ui/managewindow.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/managewindow.go b/ui/managewindow.go
index 542c91b9..e6855d5d 100644
--- a/ui/managewindow.go
+++ b/ui/managewindow.go
@@ -13,6 +13,7 @@ import (
"github.com/lxn/win"
"golang.org/x/sys/windows"
+ "golang.zx2c4.com/wireguard/windows/l18n"
"golang.zx2c4.com/wireguard/windows/manager"
)
@@ -118,7 +119,7 @@ func NewManageTunnelsWindow() (*ManageTunnelsWindow, error) {
CbSize: uint32(unsafe.Sizeof(win.MENUITEMINFO{})),
FMask: win.MIIM_ID | win.MIIM_STRING | win.MIIM_FTYPE,
FType: win.MIIM_STRING,
- DwTypeData: windows.StringToUTF16Ptr("&About WireGuard…"),
+ DwTypeData: windows.StringToUTF16Ptr(l18n.Sprintf("&About WireGuard…")),
WID: uint32(aboutWireGuardCmd),
})
win.InsertMenuItem(systemMenu, 1, true, &win.MENUITEMINFO{
@@ -169,7 +170,7 @@ func (mtw *ManageTunnelsWindow) onTunnelChange(tunnel *manager.Tunnel, state man
if len(errMsg) > 0 && errMsg[len(errMsg)-1] != '.' {
errMsg += "."
}
- showWarningCustom(mtw, "Tunnel Error", errMsg+"\n\nPlease consult the log for more information.")
+ showWarningCustom(mtw, l18n.Sprintf("Tunnel Error"), l18n.Sprintf("%s\n\nPlease consult the log for more information.", errMsg))
}
})
}
@@ -178,7 +179,7 @@ func (mtw *ManageTunnelsWindow) UpdateFound() {
if mtw.updatePage != nil {
return
}
- mtw.SetTitle(mtw.Title() + " (out of date)")
+ mtw.SetTitle(l18n.Sprintf("%s (out of date)", mtw.Title()))
updatePage, err := NewUpdatePage()
if err == nil {
mtw.updatePage = updatePage