php-i18n Digest 26 Oct 2006 08:50:37 -0000 Issue 336

Topics (messages 1027 through 1027):

xgettext & multiline string literals
        1027 by: Georg.Steffers.aschendorff.de

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
First of all hello to this list!

I am searching for this quite some time, but still could not find any 
answer.
I use gettext in my C programs with no problems some time now. So
I decided to do the same with my web projects.
It was a nearly painless start, with only one exception. I am not able
to use multiline string literals for slightly longer texts in PHP.

In C i can use the following:

_("This is just a slightly longer "
  "text for demontration purpose");

To split one long string into (what i called) a multiline string literal. 
This
works perfectly, at least with gcc and xgettext does extract the whole
string (both lines) as a key.
In PHP this is not possible at all because it simply does not allow this
syntactically.
So i tried the following in PHP:

_("This is just a slightly longer " .
  "text for demontration purpose");

But that is not understood by xgettext. The .po file does only 
contain the first row of the string as a key.

Has anyone any solution for this?


Best regards
   Georg Steffers

--- End Message ---

Reply via email to