1
|
POFILES=$(wildcard *.po)
|
2
|
MOFILES=$(POFILES:.po=.mo)
|
3
|
PYFILES=$(shell find ../extra/ ../extra-authentic/ -name '*.py' -or -name '*.ptl')
|
4
|
|
5
|
all: $(MOFILES)
|
6
|
|
7
|
install: all
|
8
|
for file in $(MOFILES); do \
|
9
|
lang=`echo $$file | sed 's/\.mo//'`; \
|
10
|
install -d $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/; \
|
11
|
install -m 0644 $$file $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/auquotidien.mo; \
|
12
|
done
|
13
|
|
14
|
auquotidien.pot: $(PYFILES)
|
15
|
@echo "Rebuilding the pot file"
|
16
|
rm -f auquotidien.pot tmp.*.pot
|
17
|
cnt=0;
|
18
|
for file in $(PYFILES); do \
|
19
|
cnt=$$(expr $$cnt + 1); \
|
20
|
bn=$$cnt.`basename $$file`; \
|
21
|
xgettext --keyword=N_ -c -L Python -o tmp.$$bn.pot $$file; \
|
22
|
done
|
23
|
msgcat tmp.*.pot > auquotidien.pot
|
24
|
rm tmp.*.pot
|
25
|
|
26
|
%.mo: %.po
|
27
|
msgfmt -o $@ $<
|
28
|
|
29
|
%.po: auquotidien.pot
|
30
|
@echo -n "Merging auquotidien.pot and $@"
|
31
|
@msgmerge $@ auquotidien.pot -o $@.new
|
32
|
@if [ "`diff $@ $@.new | grep '[<>]' | wc -l`" -ne 2 ]; then \
|
33
|
mv -f $@.new $@; \
|
34
|
else \
|
35
|
rm -f $@.new; \
|
36
|
fi
|
37
|
@msgfmt --statistics $@
|
38
|
|