-.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 pmg-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
+.PHONY: install
+install: $(PMG_LANG_FILES) $(PVE_LANG_FILES) $(PBS_LANG_FILES)
+ install -d $(PMGLOCALEDIR)
+ install -m 0644 $(PMG_LANG_FILES) $(PMGLOCALEDIR)
+ install -d $(PVELOCALEDIR)
+ install -m 0644 $(PVE_LANG_FILES) $(PVELOCALEDIR)
+ install -d $(PBSLOCALEDIR)
+ install -m 0644 $(PBS_LANG_FILES) $(PBSLOCALEDIR)
+# compat symlinks for kr -> ko correction.
+ ln -s pmg-lang-ko.js $(PMGLOCALEDIR)/pmg-lang-kr.js
+ ln -s pve-lang-ko.js $(PVELOCALEDIR)/pve-lang-kr.js
+ ln -s pbs-lang-ko.js $(PBSLOCALEDIR)/pbs-lang-kr.js
+
+pmg-lang-%.js: %.po
+ ./po2js.pl -t pmg -v "$(DEB_VERSION)" -o pmg-lang-$*.js $?
+
+pve-lang-%.js: %.po
+ ./po2js.pl -t pve -v "$(DEB_VERSION)" -o pve-lang-$*.js $?
+
+pbs-lang-%.js: %.po
+ ./po2js.pl -t pbs -v "$(DEB_VERSION)" -o pbs-lang-$*.js $?
+
+# 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
+
+.PHONY: update update_pot do_update
+update_pot: submodule
+ $(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/)
+
+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;