Update translations from source
[hermes] / package / po / Makefile
1
2
3 GETTEXT_PACKAGE = hermes
4 PACKAGE = hermes
5
6 SHELL = /bin/sh
7
8 prefix = /opt/$(PACKAGE)
9 DATADIRNAME = share
10 itlocaledir = $(prefix)/$(DATADIRNAME)/locale
11
12 INSTALL = /scratchbox/tools/bin/install -c
13 INSTALL_DATA = ${INSTALL} -m 644
14
15 GMSGFMT = /scratchbox/tools/bin/msgfmt
16 MSGFMT = /scratchbox/tools/bin/msgfmt
17 XGETTEXT = /scratchbox/tools/bin/xgettext
18 MSGMERGE = /scratchbox/tools/bin/msgmerge 
19
20 PO_LINGUAS= fi_FI fr_FR pl_PL sv_SE
21
22 USE_LINGUAS= fi_FI fr_FR pl_PL sv_SE
23
24 POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
25
26 DISTFILES = Makefile POTFILES.in $(POFILES)
27 EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
28
29 POTFILES = \
30         ../src/org/maemo/hermes/gui/accountsdialogue.py     \
31         ../src/org/maemo/hermes/gui/gtkui.py                \
32         ../src/org/maemo/hermes/gui/searchablelist.py       \
33         ../src/org/maemo/hermes/engine/provider.py          \
34         ../src/org/maemo/hermes/engine/provider_oauth.py    \
35         ../src/org/maemo/hermes/engine/linkedin/provider.py \
36         ../src/org/maemo/hermes/engine/facebook/provider.py \
37 # This comment gets stripped out
38
39 CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
40
41 .SUFFIXES:
42 .SUFFIXES: .po .gmo .mo 
43
44 .po.mo:
45         $(MSGFMT) -o $@ $<
46
47 .po.gmo:
48         file=`echo $* | sed 's,.*/,,'`.gmo \
49           && rm -f $$file && $(GMSGFMT) -o $$file $<
50
51 all: compile
52
53 compile: $(CATALOGS)
54
55 $(GETTEXT_PACKAGE).pot: $(POTFILES)
56         $(XGETTEXT) --package-name=$(PACKAGE) -o $(GETTEXT_PACKAGE).pot $(POTFILES) 
57
58 install: all
59         linguas="$(USE_LINGUAS)"; \
60         for lang in $$linguas; do \
61           dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
62           mkdir -p $$dir; \
63           if test -r $$lang.gmo; then \
64             $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
65             echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
66           fi; \
67         done
68
69 clean:  
70         rm -f *.mo *.gmo
71
72 update-po: 
73         $(MAKE) $(GETTEXT_PACKAGE).pot
74         linguas="$(USE_LINGUAS)"; \
75         for lang in $$linguas; do \
76           echo "$$lang:"; \
77           if test -r $$lang.po; then \
78             $(MSGMERGE) -U $$lang.po $(GETTEXT_PACKAGE).pot; \
79           else \
80             cp $(GETTEXT_PACKAGE).pot $$lang.po; \
81           fi; \
82         done
83