]> git.donarmstrong.com Git - lilypond.git/blobdiff - buildscripts/texi-langutils.py
readability fixes
[lilypond.git] / buildscripts / texi-langutils.py
index 02b0ea36fa683683f8df22d5e0756eae62af0f16..585816cefc04d8ba53b4a965512aa721c3c30eb2 100644 (file)
@@ -71,7 +71,7 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, output_file=No
                        g.write (i_blurb)
                        tutu = re.findall (r"""^(\*) +([^:
                        ]+)::[^
-                       ]*?$|^@(include|menu|end menu|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *([^@
+                       ]*?$|^@(include|menu|end menu|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *([^
                        ]*)[^
                        ]*?$|@(rglos){(.+?)}""", texifile, re.M)
                        node_trigger = False
@@ -79,7 +79,7 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, output_file=No
                                if item[0] == '*':
                                        g.write ('* ' + item[1] + '::\n')
                                elif output_file and item[4] == 'rglos':
-                                       output_file.write ('_("' + item[5] + '") # @rglos in ' + texifilename + '\n')
+                                       output_file.write ('_(r"' + item[5] + '") # @rglos in ' + texifilename + '\n')
                                else:
                                        g.write ('@' + item[2] + ' ' + item[3] + '\n')
                                        if node_trigger:
@@ -87,7 +87,7 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, output_file=No
                                                node_trigger = False
                                        if not item[2] in ('include', 'menu', 'end menu'):
                                                if output_file:
-                                                       output_file.write ('_("' + item[3].strip () + '") # @' + item[2] + \
+                                                       output_file.write ('_(r"' + item[3].strip () + '") # @' + item[2] + \
                                                                           ' in ' + texifilename + '\n')
                                                if item[2] == 'node':
                                                        node_trigger = True
@@ -96,16 +96,16 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, output_file=No
                        g.write (end_blurb)
                        g.close ()
                elif output_file:
-                       toto = re.findall (r"""^@(include|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *([^@
+                       toto = re.findall (r"""^@(include|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *([^
                        ]*)[^
                        ]*?$|@(rglos){(.+?)}""", texifile, re.M)
                        for item in toto:
                                if item[0] == 'include':
                                        includes.append(item[1])
                                elif item[2] == 'rglos':
-                                       output_file.write ('# @rglos in ' + texifilename + '\n_("' + item[3] + '")\n')
+                                       output_file.write ('# @rglos in ' + texifilename + '\n_(r"' + item[3] + '")\n')
                                else:
-                                       output_file.write ('# @' + item[0] + ' in ' + texifilename + '\n_("' + item[1].strip () + '")\n')
+                                       output_file.write ('# @' + item[0] + ' in ' + texifilename + '\n_(r"' + item[1].strip () + '")\n')
                if process_includes:
                        dir = os.path.dirname (texifilename)
                        for item in includes:
@@ -123,8 +123,8 @@ if make_gettext:
        node_list = open (node_list_filename, 'w')
        for texi_file in texi_files:
                process_texi (texi_file, intro_blurb, node_blurb, make_skeleton, node_list)
-       for word in ('Up:', 'Next:', 'Previous:', 'Appendix', 'Footnotes'):
-               node_list.write ('_("' + word + '")\n')
+       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_file + ' ' + node_list_filename)
 else: