From: Jan Nieuwenhuizen Date: Sat, 10 Apr 2010 12:23:38 +0000 (+0200) Subject: Fix make -C Documentation po-update. X-Git-Tag: release/2.13.18-1~15^2~55 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=858e506c2ae6bd444db27f003544416a081788d3;p=lilypond.git Fix make -C Documentation po-update. Use --keyword=_doc instead of running SED on copied sources. Add warning message in texi-langutils.py: * Why do we need node names extracted into Documentation/po and translated? That's already done inline using @translationof? * Why do we need translated node names of ALL languages there? I'm tempted to junk that and add - elif output_file: + elif output_file and scan_ly: in texi-langutils.py I.e., why do we have #. @node in Documentation/learning/tutorial.itely #. @section in Documentation/learning/tutorial.itely msgid "How to write input files" msgstr "" when this node is translated inline in Documentation//learning/tutorial.itely? And why are these? #. @node in Documentation/fr/essay.tely #. @appendix in Documentation/fr/essay.tely #. @node in Documentation/fr/learning.tely #. @appendix in Documentation/fr/learning.tely #. @node in Documentation/fr/notation.tely #. @appendix in Documentation/fr/notation.tely #. @node in Documentation/fr/usage.tely #. @appendix in Documentation/fr/usage.tely msgid "Index de LilyPond" msgstr "" #. @subsubheading in Documentation/fr/macros.itexi msgid "Commandes prédéfinies" msgstr "" --- diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index d2a4eb2f58..96dba4d8ad 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -145,7 +145,6 @@ extra-local-help: @echo " last translation update" @echo " update-translation ISOLANG=LL call $$$$EDITOR to help updating" @echo " the translation" - @echo " skeleton-update ISOLANG=LL update Texinfo skeleton files" @echo " snippet-update ISOLANG=LL update ly snippets in Texinfo translation" @echo " according to docs in English" @echo " (use with caution)" @@ -298,6 +297,9 @@ TEXI_LANGUTIL_FLAGS += --skeleton TELY_FILES = $(call src-wildcard,$(ISOLANG)/*.tely) skeleton-update: + @echo "$@ has been discontinued" + @echo "simply copy .texi, .itexi files you want to translate" + exit 2 mkdir -p $(ISOLANG) $(PYTHON) $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) $(TEXI_LANGUTIL_FLAGS) $(TELY_FILES:$(ISOLANG)/%.tely=../%.tely) $(PYTHON) $(auxscript-dir)/texi-skeleton-update.py $(ISOLANG) $(outdir) diff --git a/Documentation/po/GNUmakefile b/Documentation/po/GNUmakefile index 65d7e3a1bc..9849b93546 100644 --- a/Documentation/po/GNUmakefile +++ b/Documentation/po/GNUmakefile @@ -9,8 +9,8 @@ doc-localedir=$(outdir) LANGS = $(shell $(PYTHON) $(top-src-dir)/python/langdefs.py) DOMAIN=lilypond-doc DOC_PO_SOURCES = python/auxiliar/postprocess_html.py \ - scripts/build/texi-gettext.py scripts/auxiliar/translations-status.py -TELY_FILES = $(shell ls $(depth)/Documentation/user/*.tely) + scripts/auxiliar/tely-gettext.py scripts/auxiliar/translations-status.py +TELY_FILES = $(shell ls $(depth)/Documentation/*.tely) TELY_FILES += $(foreach l, $(LANGS), $(shell ls $(depth)/Documentation/$(l)/*.tely)) LSR_LYS := $(shell ls $(depth)/Documentation/snippets/*.ly) TELY_FILES += $(LSR_LYS:%.ly=../%.ly) @@ -27,8 +27,7 @@ $(outdir)/messages: $(MO_FILES) po-update: $(PYTHON) $(auxscript-dir)/texi-langutils.py -d $(outdir) -o texi.pot --gettext $(TELY_FILES:%.tely=../%.tely) $(foreach i, $(DOC_PO_SOURCES), cp $(top-src-dir)/$(i) $(outdir) &&) true - cd $(outdir) && sed -i -e s/_doc/_/g $(foreach i, $(DOC_PO_SOURCES), $(notdir $(i))) - cd $(outdir) && xgettext -cjn -L Python -o buildscripts.pot $(foreach i, $(DOC_PO_SOURCES), $(notdir $(i))) + cd $(outdir) && xgettext --keyword=_doc -cjn -L Python -o buildscripts.pot $(foreach i, $(DOC_PO_SOURCES), $(notdir $(i))) msgcat -o $(outdir)/doc.pot $(outdir)/buildscripts.pot $(outdir)/texi.pot msgmerge -U lilypond-doc.pot $(outdir)/doc.pot for i in $(CATALOGS); do \ diff --git a/scripts/auxiliar/texi-langutils.py b/scripts/auxiliar/texi-langutils.py index d24f80313f..056dc8964b 100755 --- a/scripts/auxiliar/texi-langutils.py +++ b/scripts/auxiliar/texi-langutils.py @@ -148,6 +148,12 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, g.close () elif output_file: + m = re.search ('Documentation/(..)/', texifilename) + if m: + lang = m.group (1) + print 'FIXME: extracting node names from:', texifilename + print 'please explain why extract translated (LANG=%(lang)s) node names into node_list' % locals () + print 'and thus into Documentation/*.po for translation?' toto = texinfo_re.findall (texifile) for item in toto: if item[0] == 'include': @@ -155,7 +161,7 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, elif item[2] == 'rglos': output_file.write ('# @rglos in ' + printedfilename + '\n_(r"' + item[3] + '")\n') else: - output_file.write ('# @' + item[0] + ' in ' + printedfilename + '\n_(r"' + item[1].strip () + '")\n') + output_file.write ('# @' + item[0] + ' in ' + printedfilename + '\n_(r"' + item[1].strip ().replace ('\\', r'\\') + '")\n') if process_includes and (not head_only or inclusion_level < 1): dir = os.path.dirname (texifilename) @@ -182,6 +188,8 @@ if make_gettext: and not 'Documentation/es/' in texi_file and not 'Documentation/fr/' in texi_file and not 'Documentation/ja/' in texi_file + and not 'Documentation/hu/' in texi_file + and not 'Documentation/it/' in texi_file and not 'Documentation/nl/' in texi_file and not 'Documentation/po/' in texi_file ) @@ -191,7 +199,7 @@ if make_gettext: for word in ('Up:', 'Next:', 'Previous:', 'Appendix ', 'Footnotes', 'Table of Contents'): node_list.write ('_(r"' + word + '")\n') node_list.close () - os.system ('xgettext -c -L Python --no-location -o ' + output_name + ' ' + node_list_filename) + os.system ('xgettext --keyword=_doc -c -L Python --no-location -o ' + output_name + ' ' + node_list_filename) else: for texi_file in texi_files: process_texi (texi_file, intro_blurb, node_blurb, make_skeleton,