summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/main.go b/main.go
index e1b2a56..d483c26 100644
--- a/main.go
+++ b/main.go
@@ -19,17 +19,22 @@ import (
"log"
"0xacab.org/leap/bitmask-systray/bitmask"
+ "github.com/jmshal/go-locale"
+ "golang.org/x/text/message"
)
const (
provider = "riseup.net"
)
+var printer *message.Printer
+
func main() {
conf, err := parseConfig()
if err != nil {
log.Fatal(err)
}
+ initPrinter()
notify := newNotificator(conf)
@@ -60,3 +65,12 @@ func checkAndInstallHelpers(b *bitmask.Bitmask, notify *notificator) {
}
}
}
+
+func initPrinter() {
+ locale, err := go_locale.DetectLocale()
+ if err != nil {
+ log.Println("Error detecting the system locale: ", err)
+ }
+
+ printer = message.NewPrinter(message.MatchLanguage(locale, "en"))
+}