]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add lilypond-book ly verbatim gettext quirk
authorJohn Mandereau <john.mandereau@gmail.com>
Wed, 31 Mar 2010 12:36:26 +0000 (14:36 +0200)
committerJohn Mandereau <john.mandereau@gmail.com>
Wed, 31 Mar 2010 12:42:22 +0000 (14:42 +0200)
Documentation/snippets/jazz-combo-template.ly contains a variable
definition named "bass", of which lilypond-book translates all
occurences in Texinfo verbatim ly code, including the case where
"bass" is an argument of the \clef command.  As variables may be used
in Scheme code and this gettextization is done without real parsing,
it's impossible to avoid such corner cases, which will thus be fixed
ad-hoc as they are discovered.

Thanks to Francisco Vila for the report.

scripts/lilypond-book.py

index 64a90310b715c317b19f57e42b1339e0e7f2c5d8..b4bd319a690d3b35aa27b969a7d0b4edd2d0435a 100644 (file)
@@ -960,7 +960,7 @@ def verb_ly_gettext (s):
 
     if langdefs.LANGDICT[document_language].enable_ly_identifier_l10n:
         for v in ly_var_def_re.findall (s):
-            s = re.sub (r"(?m)(^|[' \\#])%s([^a-zA-Z])" % v,
+            s = re.sub (r"(?m)(?<!\\clef)(^|[' \\#])%s([^a-zA-Z])" % v,
                         "\\1" + t (v) + "\\2",
                         s)
         for id in ly_context_id_re.findall (s):