X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=Makefile;h=d7a7ebd83b70551004b9d68fe6db2de639d42656;hb=c756af6929c751892edbf57e24a46559d491b95b;hp=2268cdc8d3bc2fb808eca431b47dbc25059adde4;hpb=cbc629cecca4fb6ae17c889304390cf00d06da51;p=proxmox-i18n.git diff --git a/Makefile b/Makefile index 2268cdc..d7a7ebd 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,14 @@ -LINGUAS=de fr es it +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 VERSION=1.0 -PKGREL=1 +PKGREL=9 PVE_I18N_DEB=pve-i18n_${VERSION}-${PKGREL}_all.deb PMG_I18N_DEB=pmg-i18n_${VERSION}-${PKGREL}_all.deb -DEBS=${PMG_I18N_DEB} ${PVE_I18N_DEB} +DEB1=${PMG_I18N_DEB} +DEB2=$(PVE_I18N_DEB) +DEBS=$(DEB1) $(DEB2) PMGLOCALEDIR=${DESTDIR}/usr/share/pmg-i18n PVELOCALEDIR=${DESTDIR}/usr/share/pve-i18n @@ -14,57 +16,57 @@ PVELOCALEDIR=${DESTDIR}/usr/share/pve-i18n PMG_LANG_FILES=$(patsubst %, pmg-lang-%.js, $(LINGUAS)) PVE_LANG_FILES=$(patsubst %, pve-lang-%.js, $(LINGUAS)) -all: | submodule +all: .PHONY: deb deb: $(DEBS) -$(DEBS): | submodule +$(DEB2): $(DEB1) +$(DEB1): | submodule rm -rf dest - mkdir dest - rsync -a debian dest - make DESTDIR=dest install + rsync -a * dest cd dest; dpkg-buildpackage -b -us -uc - lintian ${PMG_I18N_DEB} - lintian ${PVE_I18N_DEB} + lintian $(DEBS) .PHONY: submodule submodule: - test -f "proxmox-mailgateway-gui/Makefile" || git submodule update --init + test -f "pmg-gui/Makefile" || git submodule update --init .PHONY: install -install: ${PMG_LANG_FILES} ${PVE_LANG_FILES} +install: ${PMG_LANG_FILES} ${PVE_LANG_FILES} install -d ${PMGLOCALEDIR} install -m 0644 ${PMG_LANG_FILES} ${PMGLOCALEDIR} install -d ${PVELOCALEDIR} install -m 0644 ${PVE_LANG_FILES} ${PVELOCALEDIR} -pmg-lang-%.js: proxmox-widget-toolkit-%.po proxmox-mailgateway-%.po - ./po2js.pl -o pmg-lang-$*.js $? +pmg-lang-%.js: %.po + ./po2js.pl -t pmg -v "${VERSION}-${PKGREL}" -o pmg-lang-$*.js $? -pve-lang-%.js: proxmox-widget-toolkit-%.po pve-manager-%.po - ./po2js.pl -o pve-lang-$*.js $? +pve-lang-%.js: %.po + ./po2js.pl -t pve -v "${VERSION}-${PKGREL}" -o pve-lang-$*.js $? -.PHONY: update -update: - ./jsgettext.pl -p "proxmox-widget-toolkit 1.0" -o proxmox-widget-toolkit.pot proxmox-widget-toolkit/ - ./jsgettext.pl -p "proxmox-mailgateway 5.0" -o proxmox-mailgateway.pot -b proxmox-widget-toolkit.pot proxmox-mailgateway-gui/js/ - ./jsgettext.pl -p "pve-manager 5.0" -o pve-manager.pot -b proxmox-widget-toolkit.pot pve-manager/www/manager6/ - for j in proxmox-widget-toolkit proxmox-mailgateway pve-manager; do for i in $(LINGUAS); do echo -n "$$j-$$i: ";msgmerge -s -v $$j-$$i.po $$j.pot >$$j-$$i.po.tmp && mv $$j-$$i.po.tmp $$j-$$i.po; done; done +# parameter 1 is the name +# parameter 2 is the directory +define potupdate + ./jsgettext.pl -p "$(1) $(shell cd $(2);git rev-parse HEAD)" -o $(1).pot $(2) +endef -# try to generate po files when someone add a new language -.SECONDARY: # do not delete generated intermediate file -proxmox-widget-toolkit-%.po: proxmox-widget-toolkit.pot - msginit -i proxmox-widget-toolkit.pot -l $* -o proxmox-widget-toolkit-$*.po +.PHONY: update update_pot +update_pot: submodule + git submodule foreach 'git pull --ff-only origin master' + $(call potupdate,proxmox-widget-toolkit,proxmox-widget-toolkit/) + $(call potupdate,pve-manager,pve-manager/www/manager6/) + $(call potupdate,proxmox-mailgateway,pmg-gui/js/) -.SECONDARY: # do not delete generated intermediate file -proxmox-mailgateway-%.po: proxmox-mailgateway.pot - msginit -i proxmox-mailgateway.pot -l $* -o proxmox-mailgateway-$*.po +update: | update_pot messages.pot + 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; -.SECONDARY: # do not delete generated intermediate file -pve-manager-%.po: pve-manager.pot - msginit -i pve-manager.pot -l $* -o pve-manager-$*.po +init-%.po: messages.pot + msginit -i $^ -l $^ -o $*.po --no-translator +.INTERMEDIATE: messages.pot +messages.pot: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot + msgcat $^ > $@ .PHONY: distclean distclean: clean @@ -72,12 +74,12 @@ distclean: clean .PHONY: clean clean: find . -name '*~' -exec rm {} ';' - rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes pve-lang-*.js pmg-lang-*.js + rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes *.js messages.pot .PHONY: upload-pve upload-pve: ${PVE_I18N_DEB} - tar cf - ${PVE_I18N_DEB}|ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch + tar cf - ${PVE_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch .PHONY: upload-pmg upload-pmg: ${PMG_I18N_DEB} - tar cf - ${PMG_I18N_DEB}|ssh repoman@repo.proxmox.com -- upload --product pmg --dist stretch + tar cf - ${PMG_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch