From cf5ed56c943599c092a91933b45471c4c0e5d579 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Fri, 10 Jul 2020 11:04:49 +0200 Subject: Add support for internationalization - Resolves: #243 --- Makefile | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3