Premiere version : mise en route du suivi.
[auf_roundup.git] / locale / .svn / text-base / GNUmakefile.svn-base
CommitLineData
c638d827
CR
1# Extract translatable strings from Roundup sources,
2# update and compile all existing translations
3#
4# $Id: GNUmakefile,v 1.11 2006-11-16 14:14:42 a1s Exp $
5
6# tool locations
7XPOT ?= xpot
8MSGFMT ?= msgfmt
9MSGMERGE ?= msgmerge
10XGETTEXT ?= xgettext
11PYTHON ?= python
12
13TEMPLATE=roundup.pot
14
15PACKAGES=$(shell find ../roundup ../share/roundup/templates -name '*.py' \
16 | sed -e 's,/[^/]*$$,,' | sort | uniq)
17SOURCES=$(PACKAGES:=/*.py)
18PO_FILES=$(wildcard *.po)
19MO_FILES=$(PO_FILES:.po=.mo)
20RUN_PYTHON=PYTHONPATH=../build/lib $(PYTHON) -O
21
22all: dist
23
24help:
25 @echo "$(MAKE) - build MO files. Run this before sdist"
26 @echo "$(MAKE) template - update message template from sources"
27 @echo "$(MAKE) locale.po - update message file from template"
28 @echo "$(MAKE) locale.mo - compile individual message file"
29 @echo "$(MAKE) help - this text"\
30
31# This will rebuild all MO files without updating their corresponding PO
32# files first. Run before creating Roundup distribution (hence the name).
33# PO files should be updated by their translators only, automatic update
34# adds unwanted fuzzy labels.
35dist:
36 for file in $(PO_FILES); do \
37 ${MSGFMT} -o `basename $$file .po`.mo $$file; \
38 done
39
40template:
41 ${XPOT} -n -o $(TEMPLATE) $(SOURCES)
42 ${RUN_PYTHON} ../roundup/cgi/TAL/talgettext.py -u $(TEMPLATE) \
43 ../share/roundup/templates/classic/html/*.html \
44 ../share/roundup/templates/minimal/html/*.html
45 ${XGETTEXT} -j -w 80 -F \
46 --msgid-bugs-address=roundup-devel@lists.sourceforge.net \
47 --copyright-holder="See Roundup README.txt" \
48 -o $(TEMPLATE) $(SOURCES)
49
50# helps to check template file before check in
51diff:
52 svn diff roundup.pot|grep -v '^[-+]#'|vim -Rv -
53
54%.po: $(TEMPLATE)
55 ${MSGMERGE} -U --suffix=.bak $@ $<
56
57%.mo: %.po
58 ${MSGFMT} --statistics -o $@ $<