1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 08:39:46 +02:00

Fix failure of Nyquist to translate some multiline strings...

... Don't trim leading whitespace from source file lines before passing them
to eval.

So when a string in Lisp code is (_ "like
   this")

(the Lisp reader allows embedded newlines in quoted strings),

then the string extracted to the .pot file by xgettext contains the spaces, and
the string literal seen by our Lisp interpreter will also retain the spaces and
match the msgid in the catalog exactly.
This commit is contained in:
Paul Licameli 2018-10-29 13:43:13 -04:00
parent 5dc4185ce2
commit 0fbea5f9ea

View File

@ -2129,7 +2129,7 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream)
while (!stream.Eof() && stream.IsOk())
{
bool dollar = false;
wxString line = pgm.ReadLine().Trim(false);
wxString line = pgm.ReadLine();
if (line.Length() > 1 &&
// New in 2.3.0: allow magic comment lines to start with $
// The trick is that xgettext will not consider such lines comments
@ -2144,7 +2144,7 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream)
// Allow run-ons only for new $ format header lines
done = Parse(tzer, line, !dollar || stream.Eof(), nLines == 1);
while(!done &&
(line = pgm.ReadLine().Trim(false), ++nLines, true));
(line = pgm.ReadLine(), ++nLines, true));
// Don't pass these lines to the interpreter, so it doesn't get confused
// by $, but pass blanks,