f2 e
@end example
+@noindent
+If you would like to translate comments and variable names in verbatim
+output but not in the sources, you may set the environment variable
+@code{LYDOC_LOCALEDIR} to a directory path; the directory should
+contain a tree of @file{.mo} message catalogs with @code{lilypond-doc}
+as a domain.
+
@item addversion
(Only for Texinfo output.) Prepend line @code{\version
@@w@{"@@version@{@}"@}} to @code{verbatim} output.
The same remark about @code{texidoc} processing with localized
languages also applies to @code{doctitle}.
+@item nogettext
+(Only for Texinfo output.) Do not translate comments and variable
+names in the snippet quoted verbatim.
+
@item printfilename
If a LilyPond input file is included with @code{\lilypondfile}, print
the file name right before the music snippet. For HTML output, this
LINE_WIDTH = 'line-width'
LILYQUOTE = 'lilyquote'
NOFRAGMENT = 'nofragment'
+NOGETTEXT = 'nogettext'
NOINDENT = 'noindent'
NOQUOTE = 'noquote'
NORAGGED_RIGHT = 'noragged-right'
EXAMPLEINDENT,
FRAGMENT,
NOFRAGMENT,
+ NOGETTEXT,
NOINDENT,
PRINTFILENAME,
DOCTITLE,
self.do_options (os, self.type)
def verb_ly (self):
- return verb_ly_gettext (self.substring ('code'))
+ if NOGETTEXT in self.option_dict:
+ return self.substring ('code')
+ else:
+ return verb_ly_gettext (self.substring ('code'))
def ly (self):
contents = self.substring ('code')
file (path + '.txt', 'w').write ('image of music')
def relevant_contents (self, ly):
- return re.sub (r'\\(version|sourcefileline|sourcefilename)[^\n]*\n', '', ly)
+ return re.sub (r'\\(version|sourcefileline|sourcefilename)[^\n]*\n|' +
+ NOGETTEXT + '[,\]]', '', ly)
def link_all_output_files (self, output_dir, output_dir_files, destination):
existing, missing = self.all_output_files (output_dir, output_dir_files)