]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/stepmake/po-targets.make
Run grand-replace (issue 3765)
[lilypond.git] / stepmake / stepmake / po-targets.make
1 XGETTEXT_OPTIONS = \
2         --directory=$(src-dir) \
3         --directory=. \
4         --default-domain=$(package) \
5         --from-code=UTF-8 \
6         --join \
7         --add-comments \
8         --msgid-bugs-address="http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs" \
9         --package-name=$(package) \
10         --package-version=$(VERSION)
11
12 sed-header = \# Translation of LilyPond\n\# Copyright \(C\) 1998--2014 Han-Wen Nienhuys, Jan Nieuwenhuizen.\n\# This file is distributed under the same license as the LilyPond package.
13 sed-content = "Content-Type: text\/plain; charset=UTF-8\\n"
14
15 ####
16 #### UGH!
17 new-po:
18         if test -r $(po-srcdir); then \
19           rm -f $(po-outdir)/$(package).po; \
20           mkdir -p $(po-outdir); \
21           touch $(po-outdir)/$(package).po; \
22         fi
23
24 ifeq ($(strip $(depth)),.)
25 po: new-po
26         $(LOOP)
27 local-po:
28         @true
29 else
30 po: local-po
31         $(LOOP)
32 ALL_PO_SOURCES = $(ALL_C_SOURCES) $(ALL_CC_SOURCES) $(PYTHON_SCRIPTS_IN) $(PY_MODULES_IN) $(SCM_FILES)
33 local-po:
34 ifneq ($(strip $(ALL_PO_SOURCES)),)
35         @echo $(ALL_PO_SOURCES)
36         xgettext $(XGETTEXT_OPTIONS) --output-dir=$(po-outdir) \
37          --keyword=_ --keyword=_f --keyword=_i \
38          $(XGETTEXT_FLAGS) $(ALL_PO_SOURCES)
39 endif
40         sed -i '1,2d' $(po-outdir)/$(package).po
41         sed -i -e 's/^\# This file is distributed.*/$(sed-header)/' $(po-outdir)/$(package).po
42         sed -i -e 's/^\"Content-Type: text\/plain.*/$(sed-content)/' $(po-outdir)/$(package).po
43 endif
44
45
46 po-update: po
47         $(MAKE) -C $(po-outdir)/.. po-update
48
49 po-changes:
50         $(MAKE) -C $(po-outdir)/.. po-changes
51
52 po-replace: po
53         $(MAKE) -C $(po-outdir)/.. po-replace