diff options
author | Simon Rozman <simon@rozman.si> | 2019-11-14 09:27:05 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-15 14:49:27 -0600 |
commit | 8a476b326136f5c03790fa168686848884c8cd5a (patch) | |
tree | 3fac4f2940c3012734a4147ef627e2b52a27a859 /ui/aboutdialog.go | |
parent | manager: chdir into unelevated profile before execing (diff) | |
download | wireguard-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/aboutdialog.go')
-rw-r--r-- | ui/aboutdialog.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/aboutdialog.go b/ui/aboutdialog.go index d87727aa..238ba5e2 100644 --- a/ui/aboutdialog.go +++ b/ui/aboutdialog.go @@ -6,7 +6,6 @@ package ui import ( - "fmt" "runtime" "strings" @@ -14,6 +13,7 @@ import ( "github.com/lxn/win" "golang.org/x/sys/windows" "golang.zx2c4.com/wireguard/device" + "golang.zx2c4.com/wireguard/windows/l18n" "golang.zx2c4.com/wireguard/windows/version" ) @@ -47,7 +47,7 @@ func runAboutDialog(owner walk.Form) error { showingAboutDialog = nil }() disposables.Add(showingAboutDialog) - showingAboutDialog.SetTitle("About WireGuard") + showingAboutDialog.SetTitle(l18n.Sprintf("About WireGuard")) showingAboutDialog.SetLayout(vbl) if icon, err := loadLogoIcon(32); err == nil { showingAboutDialog.SetIcon(icon) @@ -79,7 +79,7 @@ func runAboutDialog(owner walk.Form) error { if logo, err := loadLogoIcon(128); err == nil { iv.SetImage(logo) } - iv.Accessibility().SetName("WireGuard logo image") + iv.Accessibility().SetName(l18n.Sprintf("WireGuard logo image")) wgLbl, err := walk.NewTextLabel(showingAboutDialog) if err != nil { @@ -95,7 +95,7 @@ func runAboutDialog(owner walk.Form) error { return err } detailsLbl.SetTextAlignment(walk.AlignHCenterVNear) - detailsLbl.SetText(fmt.Sprintf("App version: %s\nGo backend version: %s\nGo version: %s\nOperating system: %s\nArchitecture: %s", version.Number, device.WireGuardGoVersion, strings.TrimPrefix(runtime.Version(), "go"), version.OsName(), runtime.GOARCH)) + detailsLbl.SetText(l18n.Sprintf("App version: %s\nGo backend version: %s\nGo version: %s\nOperating system: %s\nArchitecture: %s", version.Number, device.WireGuardGoVersion, strings.TrimPrefix(runtime.Version(), "go"), version.OsName(), runtime.GOARCH)) copyrightLbl, err := walk.NewTextLabel(showingAboutDialog) if err != nil { @@ -119,14 +119,14 @@ func runAboutDialog(owner walk.Form) error { return err } closePB.SetAlignment(walk.AlignHCenterVNear) - closePB.SetText("Close") + closePB.SetText(l18n.Sprintf("Close")) closePB.Clicked().Attach(showingAboutDialog.Accept) donatePB, err := walk.NewPushButton(buttonCP) if err != nil { return err } donatePB.SetAlignment(walk.AlignHCenterVNear) - donatePB.SetText("♥ &Donate!") + donatePB.SetText(l18n.Sprintf("♥ &Donate!")) donatePB.Clicked().Attach(func() { if easterEggIndex == -1 { easterEggIndex = 0 |