]> git.proxmox.com Git - proxmox-i18n.git/commitdiff
buildsys: add intermediate target for doing the update and rework ordering
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 1 Sep 2021 08:45:28 +0000 (10:45 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 1 Sep 2021 08:45:32 +0000 (10:45 +0200)
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 <t.lamprecht@proxmox.com>
Makefile

index d77dd9b4d3065292843f40533389007d7af83107..85d5dedc8ab1d515b0fb786c2c95f2d71e91d3df 100644 (file)
--- 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