summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2020-07-10 11:04:49 +0200
committerRuben Pollan <meskio@sindominio.net>2020-07-28 13:44:58 +0200
commitcf5ed56c943599c092a91933b45471c4c0e5d579 (patch)
treec2a4f1ce4cffff3dce4c207575d15aa2a43c365f /Makefile
parentcdb42f0d6b47a60ceb647e3ac6a6ce66352dbae4 (diff)
Add support for internationalization
- Resolves: #243
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 5 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 7d284b4..4722146 100644
--- a/Makefile
+++ b/Makefile
@@ -241,23 +241,12 @@ icon:
@make -C icon
-LANGS ?= $(foreach path,$(wildcard locales/*),$(patsubst locales/%,%,$(path)))
-empty :=
-space := $(empty) $(empty)
-lang_list := $(subst $(space),,$(foreach lang,$(LANGS),$(lang),))
+LANGS ?= $(foreach path,$(wildcard gui/i18n/main_*.ts),$(patsubst gui/i18n/main_%.ts,%,$(path)))
-locales: $(foreach lang,$(LANGS),get_$(lang)) cmd/bitmask-vpn/catalog.go
+locales: $(foreach lang,$(LANGS),get_$(lang))
generate_locales:
- @gotext update -lang=$(lang_list) ./pkg/systray ./pkg/bitmask
- @make -C tools/transifex
+ @lupdate bitmask.pro
-locales/%/out.gotext.json: pkg/systray/systray.go pkg/systray/notificator.go pkg/bitmask/standalone.go
- @gotext update -lang=$* ./pkg/systray ./pkg/bitmask
-
-cmd/bitmask-vpn/catalog.go: $(foreach lang,$(LANGS),locales/$(lang)/messages.gotext.json)
- @gotext update -lang=$(lang_list) -out cmd/bitmask-vpn/catalog.go ./pkg/systray ./pkg/bitmask
-
-get_%: locales/%/out.gotext.json
- @make -C tools/transifex build
- @curl -L -X GET --user "api:${API_TOKEN}" "https://www.transifex.com/api/2/project/bitmask/resource/RiseupVPN/translation/${subst -,_,$*}/?file" | tools/transifex/transifex t2g locales/$*/
+get_%:
+ @curl -L -X GET --user "api:${API_TOKEN}" "https://www.transifex.com/api/2/project/bitmask/resource/riseupvpn-test/translation/${subst -,_,$*}/?file" > gui/i18n/main_$*.ts