]> git.proxmox.com Git - proxmox-i18n.git/blame - Makefile
normalize Polish translation
[proxmox-i18n.git] / Makefile
CommitLineData
5c0bd157 1include /usr/share/dpkg/pkg-info.mk
3f7b1143 2
1524e1af
TL
3LINGUAS=\
4 ar \
5 ca \
6 da \
7 de \
8 es \
9 eu \
10 fa \
11 fr \
12 gl \
13 he \
14 hu \
15 it \
16 ja \
17 kr \
18 nb \
19 nl \
20 nn \
21 pl \
22 pt_BR \
23 ru \
24 sl \
25 sv \
26 tr \
e0dd5e69 27 ukr \
1524e1af
TL
28 zh_CN \
29 zh_TW \
3f7b1143 30
a16dc967 31BUILDDIR ?= $(DEB_SOURCE)-$(DEB_VERSION)
3539b194 32
bf6772a1 33DSC=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
a16dc967
TL
34PVE_I18N_DEB=pve-i18n_$(DEB_VERSION)_all.deb
35PMG_I18N_DEB=pmg-i18n_$(DEB_VERSION)_all.deb
36PBS_I18N_DEB=pbs-i18n_$(DEB_VERSION)_all.deb
3f7b1143 37
a16dc967 38DEBS=$(PMG_I18N_DEB) $(PVE_I18N_DEB) $(PBS_I18N_DEB)
3f7b1143 39
a16dc967
TL
40PMGLOCALEDIR=$(DESTDIR)/usr/share/pmg-i18n
41PVELOCALEDIR=$(DESTDIR)/usr/share/pve-i18n
42PBSLOCALEDIR=$(DESTDIR)/usr/share/pbs-i18n
3f7b1143
DM
43
44PMG_LANG_FILES=$(patsubst %, pmg-lang-%.js, $(LINGUAS))
45PVE_LANG_FILES=$(patsubst %, pve-lang-%.js, $(LINGUAS))
31f04d6b 46PBS_LANG_FILES=$(patsubst %, pbs-lang-%.js, $(LINGUAS))
3f7b1143 47
ee60f2d8 48all:
3f7b1143 49
3539b194
TL
50$(BUILDDIR): submodule
51 rm -rf $@ $@.tmp
52 rsync -a * $@.tmp
53 mv $@.tmp $@
54
3f7b1143
DM
55.PHONY: deb
56deb: $(DEBS)
3539b194
TL
57$(DEBS): build-debs
58
59build-debs: $(BUILDDIR)
60 cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
ee60f2d8 61 lintian $(DEBS)
3539b194 62 touch "$@"
3f7b1143 63
d33e0403
TL
64sbuild: $(DSC)
65 sbuild $(DSC)
66
bf6772a1
TL
67.PHONY: dsc
68dsc: $(DSC)
69$(DSC): $(BUILDDIR)
70 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
71 lintian $(DSC)
72
42d82cd2 73submodule:
26220b7e
TL
74 test -f pmg-gui/Makefile -a -f proxmox-backup/Makefile -a -f pve-manager/Makefile \
75 || git submodule update --init
42d82cd2 76
3f7b1143 77.PHONY: install
a16dc967
TL
78install: $(PMG_LANG_FILES) $(PVE_LANG_FILES) $(PBS_LANG_FILES)
79 install -d $(PMGLOCALEDIR)
80 install -m 0644 $(PMG_LANG_FILES) $(PMGLOCALEDIR)
81 install -d $(PVELOCALEDIR)
82 install -m 0644 $(PVE_LANG_FILES) $(PVELOCALEDIR)
83 install -d $(PBSLOCALEDIR)
84 install -m 0644 $(PBS_LANG_FILES) $(PBSLOCALEDIR)
3f7b1143 85
c1ae7daa 86pmg-lang-%.js: %.po
a16dc967 87 ./po2js.pl -t pmg -v "$(DEB_VERSION)" -o pmg-lang-$*.js $?
3f7b1143 88
c1ae7daa 89pve-lang-%.js: %.po
a16dc967 90 ./po2js.pl -t pve -v "$(DEB_VERSION)" -o pve-lang-$*.js $?
c1ae7daa 91
31f04d6b 92pbs-lang-%.js: %.po
a16dc967 93 ./po2js.pl -t pbs -v "$(DEB_VERSION)" -o pbs-lang-$*.js $?
31f04d6b 94
c1ae7daa
DC
95# parameter 1 is the name
96# parameter 2 is the directory
97define potupdate
98 ./jsgettext.pl -p "$(1) $(shell cd $(2);git rev-parse HEAD)" -o $(1).pot $(2)
99endef
3f7b1143 100
910254e8 101.PHONY: update update_pot do_update
ee60f2d8 102update_pot: submodule
c1ae7daa
DC
103 $(call potupdate,proxmox-widget-toolkit,proxmox-widget-toolkit/)
104 $(call potupdate,pve-manager,pve-manager/www/manager6/)
105 $(call potupdate,proxmox-mailgateway,pmg-gui/js/)
31f04d6b 106 $(call potupdate,proxmox-backup,proxmox-backup/www/)
ee60f2d8 107
910254e8
TL
108do_update:
109 $(MAKE) update_pot
110 $(MAKE) messages.pot
c1ae7daa 111 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 112
910254e8
TL
113update:
114 git submodule foreach 'git pull --ff-only origin master'
115 $(MAKE) do_update
116
16b20080
RV
117stats:
118 @for i in $(LINGUAS); do echo -n "$$i: "; msgfmt --statistics -o /dev/null $$i.po; done
119
ee60f2d8
TL
120init-%.po: messages.pot
121 msginit -i $^ -l $^ -o $*.po --no-translator
122
123.INTERMEDIATE: messages.pot
31f04d6b 124messages.pot: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot proxmox-backup.pot
ee60f2d8 125 msgcat $^ > $@
cbc629ce
DM
126
127.PHONY: distclean
128distclean: clean
129
3f7b1143
DM
130.PHONY: clean
131clean:
bf6772a1 132 rm -rf $(DEB_SOURCE)-[0-9]*/ *.po.tmp *.js.tmp *.deb *.dsc *.tar.* *.build *.buildinfo *.changes *.js messages.pot
cbc629ce 133
0a877479 134.PHONY: upload-pve upload-pmg upload-pbs upload
86f072ca 135upload-%: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
a16dc967 136upload-pve: $(PVE_I18N_DEB)
86f072ca 137 tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST)
a16dc967 138upload-pmg: $(PMG_I18N_DEB)
86f072ca 139 tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist $(UPLOAD_DIST)
a16dc967 140upload-pbs: $(PBS_I18N_DEB)
86f072ca 141 tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pbs --dist $(UPLOAD_DIST)
0a877479
TL
142
143upload: upload-pve upload-pmg upload-pbs