From: Thomas Lamprecht Date: Wed, 1 Sep 2021 08:45:28 +0000 (+0200) Subject: buildsys: add intermediate target for doing the update and rework ordering X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;ds=sidebyside;h=910254e8976b48408f947b6066cf4e03fc538cbc;p=proxmox-i18n.git buildsys: add intermediate target for doing the update and rework ordering calling do_update allows one to refresh the .po files without pulling in new submodule updates, that is useful when external contributors send in a translations update by sending the whole .po file via mail, with a possible older git commit as base. This way one can refresh line numbers and new messages while keeping the updated state they send. Doing the order via explicit `$(MAKE) target` invocations seems simpler and less error prone too. Signed-off-by: Thomas Lamprecht --- diff --git a/Makefile b/Makefile index d77dd9b..85d5ded 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,6 @@ install: ${PMG_LANG_FILES} ${PVE_LANG_FILES} ${PBS_LANG_FILES} install -d ${PBSLOCALEDIR} install -m 0644 ${PBS_LANG_FILES} ${PBSLOCALEDIR} - pmg-lang-%.js: %.po ./po2js.pl -t pmg -v "${VERSION}-${PKGREL}" -o pmg-lang-$*.js $? @@ -58,17 +57,22 @@ define potupdate ./jsgettext.pl -p "$(1) $(shell cd $(2);git rev-parse HEAD)" -o $(1).pot $(2) endef -.PHONY: update update_pot +.PHONY: update update_pot do_update 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/) $(call potupdate,proxmox-backup,proxmox-backup/www/) -update: | update_pot messages.pot +do_update: + $(MAKE) update_pot + $(MAKE) 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; +update: + git submodule foreach 'git pull --ff-only origin master' + $(MAKE) do_update + stats: @for i in $(LINGUAS); do echo -n "$$i: "; msgfmt --statistics -o /dev/null $$i.po; done