bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x-scheme fails to parse multiline strings


From: Tim Janik
Subject: Re: x-scheme fails to parse multiline strings
Date: Fri, 21 Apr 2006 12:37:52 +0200 (CEST)

On Fri, 21 Apr 2006, Bruno Haible wrote:

Tim Janik wrote:

This is normal. The code that you wrote doesn't use multiline strings;
instead your N_ appears to be a function that receives 1 or 2 (or more?)
strings and concatenates them.

By multiline strings, I understand strings with embedded newlines (these
are allowed in Scheme, see
http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-10.html#%_sec_7.1.1)
xgettext extracts them correctly, preserving the newlines correctly:

======================= foo.scm ===========================
  (bse-script-register 'mixer-splitup-by-track
                       ""
                       (N_ "/Song/Assign Tracks to individual Mixer Busses")
                       (N_ "This script creates a new Mixer Bus for each track 
in the
song that is currently using the Master Bus as output.")
                       "Stefan Westerfeld"
                       "GNU General Public License"
                       (bse-param-song (N_ "Song")))
  [...]
  (if (not (bse-is-song song))
      (bse-exit-error 'text1 (_ "No valid song supplied")))
=============================================================
$ xgettext --keyword=_  --keyword=N_ -o - foo.scm
...
#: foo.scm:4
msgid ""
"This script creates a new Mixer Bus for each track in the\n"
"song that is currently using the Master Bus as output."
msgstr ""

is there anything i can help with to get this fixed?

xgettext does not support automatic concatenation of strings, because this
is a feature rarely found in languages of the Lisp family.

hm, how are long blurbs in lisp code translated then?

You can of course modify xgettext so that it concatenates all arguments to
a particular function. But IMO it would be easier to just concatenate the
two strings in the Scheme source code.

well, that would just work for this particular example, here's another one:

(bse-script-register 'part-harmonic-transposer
                     ""
                     (N_ "/Part/Harmonic Transposer")
                     ;; FIXME: the description may be suboptimal; the problem is
                     ;; that I can't precisely describe details of musical 
theory
                     ;; in english. -- stw
                     (N_ "The harmonic transposer takes the selection of a part 
"
                         "and transposes it to different harmonies. If you for "
                         "instance have selected a measure filled with C major "
                         "chords, and enter \"C,Am,F,G\" as harmonic sequence, "
                         "the result will be four measures, filled with C major, 
"
                         "A minor, F major and G major chords. "
                         "\n\n"
                         "This also works for melodies, so you can transpose a "
                         "whole melody written in G major to D minor. The standard 
"
                         "scales used in church music (ionian, dorian, phrygian, 
"
                         "lydian, mixolydian, aeolian, locrian) are also supported: 
"
                         "it is for instance possible to write Ddorian or Caeolian. 
"
                         "The aeolian scale is equivalent to minor and the ionian 
"
                         "scale is equivalent to major. "
                         "\n\n"
                         "Since musically, there is no preference on whether to 
transpose up or "
                         "down it is possible to specify the first harmony that will 
be transposed "
                         "down (all harmonies below this will be transposed up). It 
is possible "
                         "to omit this value. Then all notes will be transposed 
up.")
                     "Stefan Westerfeld"
                     "GNU General Public License"
                     (bse-param-part   (N_ "Part"))
                     (bse-param-string (N_ "Harmony Sequence") "C,Amin,F,G")
                     (bse-param-string (N_ "Transpose down starting at") "F"))

don't you agree that supporting multi arg strings (as we do in C as well)
is the better option here?
i'd be happy to fix this in xgettext so scheme translation support is as
up on par with C, if you consider the basic approach worth working on.


Bruno


---
ciaoTJ




reply via email to

[Prev in Thread] Current Thread [Next in Thread]