xgettext & multiline string literals
| From: | Georg dot Steffers at aschendorff dot de | Date: | Thu, 26 Oct 2006 08:50:31 +0000 |
| Subject: | xgettext & multiline string literals | ||
| Groups: | php.i18n | ||
| Request: | Send a blank email to php-i18n+get-1027@lists.php.net to get a copy of this 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