From: John Mandereau Date: Tue, 13 Mar 2007 17:20:38 +0000 (+0100) Subject: Fix HTML Info docs gettext trickery X-Git-Tag: release/2.11.22-1~64 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=581a9e911b8c7a828717589eb067d5b7208221a1;p=lilypond.git Fix HTML Info docs gettext trickery --- diff --git a/buildscripts/html-gettext.py b/buildscripts/html-gettext.py index 4583d37c5d..edf7d197c0 100644 --- a/buildscripts/html-gettext.py +++ b/buildscripts/html-gettext.py @@ -32,11 +32,15 @@ my_gettext = t.gettext html_codes = ((' -- ', ' – '), (' --- ', ' — ')) +html2texi_command = re.compile (r'(.*?)') +texi2html_command = re.compile (r'@command{(.*?)}') def _ (s): for c in html_codes: s = s.replace (c[1], c[0]) + s = html2texi_command.sub (r'@command{\1}', s) s = my_gettext (s) + s = texi2html_command.sub (r'\1', s) for c in html_codes: s = s.replace (c[0], c[1]) return s @@ -67,7 +71,7 @@ for filename in args[3:]: f.close() page = re.sub (r'', link_gettext, page) page = re.sub (r'([^<]*?) - ([^<]*?)', title_gettext, page) - page = re.sub (r')((?:|)(?:[\d.]+ |))([^<]+)(|)(:)?', a_href_gettext, page) + page = re.sub (r')((?:|)(?:[\d.]+ |))([^<]+)(|)(:)?', a_href_gettext, page) page = re.sub (r'([\d.]+ |)?([^<]+)', h_gettext, page) page = re.sub (r'(.+?)', rglos_gettext, page) for w in ('Next:', 'Previous:', 'Up:'): diff --git a/buildscripts/texi-langutils.py b/buildscripts/texi-langutils.py index 8fc24187de..4e54169dd0 100644 --- a/buildscripts/texi-langutils.py +++ b/buildscripts/texi-langutils.py @@ -123,7 +123,7 @@ 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'): + for word in ('Up:', 'Next:', 'Previous:', 'Appendix', 'Footnotes', 'Table of Contents'): node_list.write ('_("' + word + '")\n') node_list.close () os.system ('xgettext -c -L Python --no-location -o ' + output_file + ' ' + node_list_filename)