Use gettext .po files for translations

This allows the same workflow as most other projects for translations.
This commit is contained in:
Pierre Ossman
2016-11-14 22:00:21 +01:00
parent 45729def6d
commit 3cdc603aa4
19 changed files with 536 additions and 111 deletions

29
po/Makefile Normal file
View File

@@ -0,0 +1,29 @@
all:
.PHONY: update-po update-js update-pot
LINGUAS := de el nl sv
VERSION := $(shell grep '"version"' ../package.json | cut -d '"' -f 4)
POFILES := $(addsuffix .po,$(LINGUAS))
JSFILES := $(addprefix ../app/locale/,$(addsuffix .js,$(LINGUAS)))
update-po: $(POFILES)
update-js: $(JSFILES)
%.po: noVNC.pot
msgmerge --update --lang=$* $@ $<
../app/locale/%.js: %.po
./po2js $< $@
update-pot:
xgettext --output=noVNC.pot \
--copyright-holder="Various Authors" \
--package-name="noVNC" \
--package-version="$(VERSION)" \
--msgid-bugs-address="novnc@googlegroups.com" \
--add-comments=TRANSLATORS: \
--sort-by-file \
../app/*.js \
../core/*.js \
../core/input/*.js