]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix make -C Documentation po-update.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sat, 10 Apr 2010 12:23:38 +0000 (14:23 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sat, 10 Apr 2010 12:23:38 +0000 (14:23 +0200)
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/<LANG>/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 ""

Documentation/GNUmakefile
Documentation/po/GNUmakefile
scripts/auxiliar/texi-langutils.py

index d2a4eb2f58345f5ccb5c9cf1bb0eb6750079a998..96dba4d8ada44ae491d435436a70959966a85f41 100644 (file)
@@ -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)
index 65d7e3a1bc6145b01868539afb2613dce9ca9d1b..9849b93546593a2eff8351f432708b95d8f595ae 100644 (file)
@@ -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 \
index d24f80313fc04ddd29e85cd78ed7323236ffabc0..056dc8964bf8102f7d73a0a06350cfb72e753d07 100755 (executable)
@@ -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,