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