path: root/ui/iconprovider.go
diff options
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/iconprovider.go
parentmanager: chdir into unelevated profile before execing (diff)
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 '')
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/iconprovider.go b/ui/iconprovider.go
index e5177ac3..8db841c5 100644
--- a/ui/iconprovider.go
+++ b/ui/iconprovider.go
@@ -8,6 +8,7 @@ package ui
import (
+ "golang.zx2c4.com/wireguard/windows/l18n"
@@ -87,15 +88,15 @@ func iconForState(state manager.TunnelState, size int) (icon *walk.Icon, err err
func textForState(state manager.TunnelState, withEllipsis bool) (text string) {
switch state {
case manager.TunnelStarted:
- text = "Active"
+ text = l18n.Sprintf("Active")
case manager.TunnelStarting:
- text = "Activating"
+ text = l18n.Sprintf("Activating")
case manager.TunnelStopped:
- text = "Inactive"
+ text = l18n.Sprintf("Inactive")
case manager.TunnelStopping:
- text = "Deactivating"
+ text = l18n.Sprintf("Deactivating")
case manager.TunnelUnknown:
- text = "Unknown state"
+ text = l18n.Sprintf("Unknown state")
if withEllipsis {
switch state {