summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-02-21 12:06:58 +0100
committerRuben Pollan <meskio@sindominio.net>2018-02-21 15:46:21 +0100
commit868b796e77146e259c36789666282007cf80cc9b (patch)
treea6847eec043757fd4a386ec19002ca1fad1d7966 /Makefile
parente843f609fcedc9d5bc15c762429bca9cc3c3f8b0 (diff)
[feat] add i18n support
Using golang.org/x/text, wich is still in early stages of development, but seems to work good enough for our needs. - Resolves: #2
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9699c47
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+.PHONY: all build icon locales generate_locales clean
+
+all: icon locales build
+
+build: icon catalog.go
+ go build
+
+clean:
+ make -C icon clean
+ rm bitmask-systray
+
+icon:
+ make -C icon
+
+
+LANGS ?= $(foreach path,$(wildcard locales/*/messages.gotext.json),$(patsubst locales/%/messages.gotext.json,%,$(path)))
+empty :=
+space := $(empty) $(empty)
+lang_list := $(subst $(space),,$(foreach lang,$(LANGS),$(lang),))
+
+locales: catalog.go
+
+generate_locales: $(foreach lang,$(LANGS),locales/$(lang)/out.gotext.json)
+
+locales/%/out.gotext.json: systray.go notificator.go
+ gotext update -lang=$*
+
+catalog.go: $(foreach lang,$(LANGS),locales/$(lang)/messages.gotext.json)
+ gotext update -lang=$(lang_list) -out catalog.go