| 1 |
PO_FILES := $(wildcard *.po) |
| 2 |
MO_FILES := $(patsubst %.po,%.mo,$(PO_FILES)) |
| 3 |
LANGS := $(patsubst %.po,%,$(PO_FILES)) |
| 4 |
|
| 5 |
all : messages.pot $(MO_FILES) |
| 6 |
|
| 7 |
messages.pot: ../debdelta Makefile |
| 8 |
xgettext -L Python -d debdelta --from-code=UTF-8 -o messages.pot ../debdelta |
| 9 |
for L in $(LANGS) ; do \ |
| 10 |
msgmerge --previous -o $$L~new~.po $$L.po messages.pot ; \ |
| 11 |
if ! diff -q $$L~new~.po $$L.po ; then mv $$L~new~.po $$L.po ; echo Please edit $$L.po ; else rm $$L~new~.po ; echo No significant changes ; fi ; done |
| 12 |
|
| 13 |
.po.mo : |
| 14 |
msgfmt -c -o ~~$@~~ $< && mv ~~$@~~ $@ |
| 15 |
|
| 16 |
.SUFFIXES: .po .mo |
| 17 |
|
| 18 |
#lib/po/messages.pot : Makefile lib/EElection/*py lib/EElection/plugins/*py lib/EBallotbox/*py |
| 19 |
# xgettext -o lib/po/messages.pot lib/EElection/*py lib/EElection/plugins/*py lib/EBallotbox/*py |
| 20 |
# cd lib/po && msgmerge -o itnew.po it.po messages.pot |
| 21 |
# @if ! diff -q lib/po/itnew.po lib/po/it.po ; then mv lib/po/itnew.po lib/po/it.po ; echo Please edit lib/po/it.po ; else rm lib/po/itnew.po ; echo No changes ; fi |
| 22 |
|
| 23 |
|
| 24 |
#lib/locale/it/LC_MESSAGES/e-election.mo : lib/po/it.po |
| 25 |
# msgfmt -o lib/locale/it/LC_MESSAGES/e-election.mo~~ --statistics lib/po/it.po && mv lib/locale/it/LC_MESSAGES/e-election.mo~~ lib/locale/it/LC_MESSAGES/e-election.mo |