]> git.proxmox.com Git - proxmox-i18n.git/blame - Makefile
update Traditional Chinese translations
[proxmox-i18n.git] / Makefile
CommitLineData
e0cc1a74 1LINGUAS=de it fr ja es sv ru tr zh_CN zh_TW da ca pl sl nb nn pt_BR eu fa gl hu
3f7b1143
DM
2
3VERSION=1.0
d3abac2d 4PKGREL=7
3f7b1143
DM
5
6PVE_I18N_DEB=pve-i18n_${VERSION}-${PKGREL}_all.deb
7PMG_I18N_DEB=pmg-i18n_${VERSION}-${PKGREL}_all.deb
8
4ee74b5e
WB
9DEB1=${PMG_I18N_DEB}
10DEB2=$(PVE_I18N_DEB)
11DEBS=$(DEB1) $(DEB2)
3f7b1143
DM
12
13PMGLOCALEDIR=${DESTDIR}/usr/share/pmg-i18n
14PVELOCALEDIR=${DESTDIR}/usr/share/pve-i18n
15
16PMG_LANG_FILES=$(patsubst %, pmg-lang-%.js, $(LINGUAS))
17PVE_LANG_FILES=$(patsubst %, pve-lang-%.js, $(LINGUAS))
18
ee60f2d8 19all:
3f7b1143
DM
20
21.PHONY: deb
22deb: $(DEBS)
4ee74b5e
WB
23$(DEB2): $(DEB1)
24$(DEB1): | submodule
3f7b1143 25 rm -rf dest
ee60f2d8 26 rsync -a * dest
3f7b1143 27 cd dest; dpkg-buildpackage -b -us -uc
ee60f2d8 28 lintian $(DEBS)
3f7b1143 29
42d82cd2
DM
30.PHONY: submodule
31submodule:
80273b30 32 test -f "pmg-gui/Makefile" || git submodule update --init
42d82cd2 33
3f7b1143 34.PHONY: install
ee60f2d8 35install: ${PMG_LANG_FILES} ${PVE_LANG_FILES}
3f7b1143
DM
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
c1ae7daa
DC
42pmg-lang-%.js: %.po
43 ./po2js.pl -t pmg -v "${VERSION}-${PKGREL}" -o pmg-lang-$*.js $?
3f7b1143 44
c1ae7daa
DC
45pve-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
50define potupdate
51 ./jsgettext.pl -p "$(1) $(shell cd $(2);git rev-parse HEAD)" -o $(1).pot $(2)
52endef
3f7b1143 53
ee60f2d8
TL
54.PHONY: update update_pot
55update_pot: submodule
c1ae7daa
DC
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/)
ee60f2d8
TL
60
61update: | update_pot messages.pot
c1ae7daa 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;
3f7b1143 63
ee60f2d8
TL
64init-%.po: messages.pot
65 msginit -i $^ -l $^ -o $*.po --no-translator
66
67.INTERMEDIATE: messages.pot
68messages.pot: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot
69 msgcat $^ > $@
cbc629ce
DM
70
71.PHONY: distclean
72distclean: clean
73
3f7b1143
DM
74.PHONY: clean
75clean:
76 find . -name '*~' -exec rm {} ';'
ee60f2d8 77 rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes *.js messages.pot
cbc629ce
DM
78
79.PHONY: upload-pve
80upload-pve: ${PVE_I18N_DEB}
ded3002e 81 tar cf - ${PVE_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch
cbc629ce
DM
82
83.PHONY: upload-pmg
84upload-pmg: ${PMG_I18N_DEB}
ded3002e 85 tar cf - ${PMG_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch