]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/auxiliar/texi-langutils.py
LSR: Update.
[lilypond.git] / scripts / auxiliar / texi-langutils.py
index 0080f11a62c1e32154f7561e3e031086e799c7f8..f35ebb8e731b8ff29aa5f8cf0c922050da9f496f 100755 (executable)
@@ -59,7 +59,7 @@ for x in optlist:
     elif x[0] == '-l': # -l ISOLANG  set documentlanguage to ISOLANG
         doclang = '; documentlanguage: ' + x[1]
 
-texinfo_with_menus_re = re.compile (r"^(\*) +([^:\n]+)::.*?$|^@(afourpaper|author|bye|contents|copying|end copying|divClass|divEnd|divId|documentencoding|documentlanguage|finalout|ifnottex|end ifnottex|imageFloat|imageId|include|menu|end menu|node|quotation|end quotation|ref|rgloss|setfilename|settitle|set|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|titlefont|titlepage|end titlepage|title|subtitle|top|vskip|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading|c) *(([^ \n].*)|$)", re.M)
+texinfo_with_menus_re = re.compile (r"^(\*) +([^:\n]+)::.*?$|^@(afourpaper|author|bye|contents|copying|end copying|divClass|divEnd|divId|documentencoding|documentlanguage|finalout|ifnottex|end ifnottex|imageClickable|imageFloat|imageId|image|include|menu|end menu|node|quotation|end quotation|ref|rgloss|setfilename|settitle|set|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|titlefont|titlepage|end titlepage|title|sourceimage|subtitle|top|vskip|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading|c) *(([^ \n].*)|$)", re.M)
 
 texinfo_re = re.compile (r"^@(include|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *(.+?)$|@(rglos){(.+?)}", re.M)
 
@@ -110,7 +110,7 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, outpu
             subst.update (locals ())
             g.write (i_blurb % subst)
             tutu = texinfo_with_menus_re.findall (texifile)
-            node_trigger = False
+            node_just_defined = ''
             for item in tutu:
                 if item[0] == '*':
                     g.write ('* ' + item[1] + '::\n')
@@ -127,9 +127,10 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, outpu
                     if item[3].startswith ('{') or not item[3].strip ():
                         space = ''
                     g.write ('@' + item[2] + space + item[3] + '\n')
-                    if node_trigger:
+                    if node_just_defined:
+                        g.write ('@translationof ' + node_just_defined + '\n')
                         g.write (n_blurb)
-                        node_trigger = False
+                        node_just_defined = ''
                     elif item[2] == 'include':
                         includes.append (item[3])
                     else:
@@ -137,7 +138,7 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, outpu
                             output_file.write ('# @' + item[2] + ' in ' + \
                                 printedfilename + '\n_(r"' + item[3].strip () + '")\n')
                         if item[2] == 'node':
-                            node_trigger = True
+                            node_just_defined = item[3].strip ()
             g.write (end_blurb)
             g.close ()