]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - locale/Makefile
Fix so that xgettext scans templates, too, for strings to translate.
[SourceForge/phpwiki.git] / locale / Makefile
1 # $Id: Makefile,v 1.3 2001-11-29 03:04:36 dairiki Exp $
2 #
3 # locale/Makefile
4 #
5 # This is a replacement for locale/translate.sh to avoid remaking files that
6 # don't need to be remade.
7 #
8
9 ALL_LINGUAS = nl es de sv it
10
11 PO_FILES = $(patsubst %, po/%.po, ${ALL_LINGUAS})
12 MO_FILES = $(patsubst %, %/LC_MESSAGES/phpwiki.mo, ${ALL_LINGUAS})
13 PHP_FILES = ${MO_FILES:.mo=.php}
14
15 PHP_SRC := $(wildcard ../lib/*.php ../admin/*.php ../templates/*.html)
16
17 .PHONY: all po mo
18
19 all     : po mo
20 po      : ${PO_FILES}
21 mo      : ${MO_FILES} ${PHP_FILES}
22
23 po/phpwiki.pot : ${PHP_SRC}
24         xgettext -L C++ -k_ -o $@ $^
25
26 po/%.po : po/phpwiki.pot
27         test -f $@ || touch $@
28         cp -f $@ $@~
29         msgmerge -o $@.new $@~ $^ && mv -f $@.new $@
30
31 %/LC_MESSAGES/phpwiki.mo : po/%.po
32         mkdir -p $*/LC_MESSAGES
33         msgfmt -o $@ $<
34
35 # Generate .php from .mo rather than .po to maximize
36 # the probability of agreement between .mo and .php files.
37 %/LC_MESSAGES/phpwiki.php : %/LC_MESSAGES/phpwiki.mo
38         msgunfmt $< | awk -f make-php-trans.awk > $@
39