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