1 # List here all source files with translatable strings.
2 POTFILES=$(sort $(shell find ../IkiWiki -type f -name \*.pm)) \
3 ../ikiwiki.in ../IkiWiki.pm
5 POFILES=$(wildcard *.po)
6 MOFILES=$(POFILES:.po=.mo)
8 all: ikiwiki.pot $(MOFILES)
11 for file in $(MOFILES); do \
12 lang=`echo $$file | sed 's/\.mo//'`; \
13 install -d $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/; \
14 install -m 0644 $$file $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/ikiwiki.mo; \
17 ikiwiki.pot: $(POTFILES)
18 @echo "Rebuilding the pot file"
19 xgettext $(POTFILES) -o ikiwiki.pot -Lperl --add-comments=translators
22 rm -f $(MOFILES) messages messages.mo
28 @echo -n "Merging ikiwiki.pot and $@"
29 @msgmerge $@ ikiwiki.pot -o $@.new 2>&1
30 # Typically all that changes was a date. I'd prefer not to commit such
31 # changes, so detect and ignore them.
32 @if [ "`diff $@ $@.new | grep '[<>]' | wc -l`" -ne 2 ]; then \
37 @msgfmt --statistics $@ 2>&1
40 @for file in $(POFILES); do \
41 lang=`echo $$file | sed 's/\.po//'`; \
43 msgfmt -o /dev/null -c -v --statistics $$lang.po;\