1 |
|
2 |
all: |
3 |
@echo 'Usage:' |
4 |
@echo ' make pot create thuban.pot' |
5 |
@echo ' make update-po merge a new thuban.po with the *.po files' |
6 |
@echo ' make mo create the mo files' |
7 |
|
8 |
MO_DIR = ../Resources/Locale |
9 |
PO_DIR = po |
10 |
DOMAIN = thuban |
11 |
|
12 |
LIST_POTFILES = grep -l "_(\"" ../Thuban/*.py ../Thuban/*/*.py |
13 |
|
14 |
|
15 |
pot: |
16 |
xgettext -k_ -o $(DOMAIN).pot `$(LIST_POTFILES)` |
17 |
|
18 |
update-po: |
19 |
for po in *.po; do \ |
20 |
lingua=`basename $$po .po`; \ |
21 |
mv $$lingua.po $$lingua.old.po; \ |
22 |
if msgmerge -o $$lingua.po $$lingua.old.po $(DOMAIN).pot; then\ |
23 |
rm $$lingua.old.po; \ |
24 |
else \ |
25 |
rm -f $$lingua.po; \ |
26 |
mv $$lingua.old.po $$lingua.po; \ |
27 |
fi \ |
28 |
done |
29 |
|
30 |
|
31 |
mo: |
32 |
for po in *.po; do\ |
33 |
lingua=`basename $$po .po`; \ |
34 |
install -d $(MO_DIR)/$$lingua/LC_MESSAGES/ ; \ |
35 |
echo -n $$po": "; \ |
36 |
msgfmt --statistics \ |
37 |
-o $(MO_DIR)/$$lingua/LC_MESSAGES/$(DOMAIN).mo $$po ;\ |
38 |
done |
39 |
|