summaryrefslogtreecommitdiff
path: root/po/Makefile
diff options
context:
space:
mode:
authorPierre Ossman <pierre@ossman.eu>2016-11-14 22:00:21 +0100
committerPierre Ossman <pierre@ossman.eu>2016-11-17 20:42:08 +0100
commit3cdc603aa45850af1e9c25a5a6f28becc6196d2c (patch)
tree0bc8472879f27e427d268d46db5b83b94ff36606 /po/Makefile
parent45729def6d7d0c4bc8327cf331554680100da3ad (diff)
downloadnovnc-3cdc603aa45850af1e9c25a5a6f28becc6196d2c.tar.gz
Use gettext .po files for translations
This allows the same workflow as most other projects for translations.
Diffstat (limited to 'po/Makefile')
-rw-r--r--po/Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/po/Makefile b/po/Makefile
new file mode 100644
index 0000000..d09d164
--- /dev/null
+++ b/po/Makefile
@@ -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