diff options
author | Ruben Pollan <meskio@sindominio.net> | 2018-11-15 17:23:51 -0600 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2018-11-19 20:58:02 -0600 |
commit | bb59e562d396684ac20347498a861ed32fbb8b57 (patch) | |
tree | c4e04d6c82cfe10f65b7e98c7c3da07ad673708a /Makefile | |
parent | e090ea1a2da8c4ff5e98fb09e37d51042e380b0a (diff) |
[feat] Generate messages.json for transifex
Add to 'make generate_locales' the generation of a
'transifex/messages.json' that will be automatically pulled by transifex
for translations.
To incorporate translations from transifex into our project we'll need
to manually download the selected translations and convert them with the
transifex program into gotext format.
-Resolves: #73
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -31,17 +31,22 @@ get_deps: sudo apt install libgtk-3-dev libappindicator3-dev golang pkg-config -LANGS ?= $(foreach path,$(wildcard locales/*/messages.gotext.json),$(patsubst locales/%/messages.gotext.json,%,$(path))) +LANGS ?= $(foreach path,$(wildcard locales/*),$(patsubst locales/%,%,$(path))) empty := space := $(empty) $(empty) lang_list := $(subst $(space),,$(foreach lang,$(LANGS),$(lang),)) -locales: catalog.go +locales: $(foreach lang,$(LANGS),get_$(lang)) catalog.go generate_locales: $(foreach lang,$(LANGS),locales/$(lang)/out.gotext.json) + make -C transifex 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 + +get_%: + make -C transifex build + curl -L -X GET --user "api:${API_TOKEN}" "https://www.transifex.com/api/2/project/bitmask/resource/RiseupVPN/translation/${subst -,_,$*}/?file" | transifex/transifex t2g locales/$*/ |