]> git.proxmox.com Git - proxmox-i18n.git/blame_incremental - Makefile
update traditional Chinese translations
[proxmox-i18n.git] / Makefile
... / ...
CommitLineData
1include /usr/share/dpkg/pkg-info.mk
2
3LINGUAS=de it fr ja es sv ru tr zh_CN zh_TW da ca pl sl nb nn pt_BR eu fa gl hu he ar
4
5PVE_I18N_DEB=pve-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
6PMG_I18N_DEB=pmg-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
7
8DEB1=${PMG_I18N_DEB}
9DEB2=$(PVE_I18N_DEB)
10DEBS=$(DEB1) $(DEB2)
11
12PMGLOCALEDIR=${DESTDIR}/usr/share/pmg-i18n
13PVELOCALEDIR=${DESTDIR}/usr/share/pve-i18n
14
15PMG_LANG_FILES=$(patsubst %, pmg-lang-%.js, $(LINGUAS))
16PVE_LANG_FILES=$(patsubst %, pve-lang-%.js, $(LINGUAS))
17
18all:
19
20.PHONY: deb
21deb: $(DEBS)
22$(DEB2): $(DEB1)
23$(DEB1): | submodule
24 rm -rf dest
25 rsync -a * dest
26 cd dest; dpkg-buildpackage -b -us -uc
27 lintian $(DEBS)
28
29.PHONY: submodule
30submodule:
31 test -f "pmg-gui/Makefile" || git submodule update --init
32
33.PHONY: install
34install: ${PMG_LANG_FILES} ${PVE_LANG_FILES}
35 install -d ${PMGLOCALEDIR}
36 install -m 0644 ${PMG_LANG_FILES} ${PMGLOCALEDIR}
37 install -d ${PVELOCALEDIR}
38 install -m 0644 ${PVE_LANG_FILES} ${PVELOCALEDIR}
39
40
41pmg-lang-%.js: %.po
42 ./po2js.pl -t pmg -v "${VERSION}-${PKGREL}" -o pmg-lang-$*.js $?
43
44pve-lang-%.js: %.po
45 ./po2js.pl -t pve -v "${VERSION}-${PKGREL}" -o pve-lang-$*.js $?
46
47# parameter 1 is the name
48# parameter 2 is the directory
49define potupdate
50 ./jsgettext.pl -p "$(1) $(shell cd $(2);git rev-parse HEAD)" -o $(1).pot $(2)
51endef
52
53.PHONY: update update_pot
54update_pot: submodule
55 git submodule foreach 'git pull --ff-only origin master'
56 $(call potupdate,proxmox-widget-toolkit,proxmox-widget-toolkit/)
57 $(call potupdate,pve-manager,pve-manager/www/manager6/)
58 $(call potupdate,proxmox-mailgateway,pmg-gui/js/)
59
60update: | update_pot messages.pot
61 for i in $(LINGUAS); do echo -n "$$i: "; msgmerge -s -v $$i.po messages.pot >$$i.po.tmp && mv $$i.po.tmp $$i.po; done;
62
63stats:
64 @for i in $(LINGUAS); do echo -n "$$i: "; msgfmt --statistics -o /dev/null $$i.po; done
65
66init-%.po: messages.pot
67 msginit -i $^ -l $^ -o $*.po --no-translator
68
69.INTERMEDIATE: messages.pot
70messages.pot: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot
71 msgcat $^ > $@
72
73.PHONY: distclean
74distclean: clean
75
76.PHONY: clean
77clean:
78 find . -name '*~' -exec rm {} ';'
79 rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes *.js messages.pot
80
81.PHONY: upload-pve
82upload-pve: ${PVE_I18N_DEB}
83 tar cf - ${PVE_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist buster
84
85.PHONY: upload-pmg
86upload-pmg: ${PMG_I18N_DEB}
87 tar cf - ${PMG_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch