Guido Flohr wrote:
I don't think that this is an option because xgettext.pl will also
double the backslash in the original string (like "xgettext --lang=C"
which doesn't know that a dollar sign has to be escaped in double-quoted
Perl strings).
That's right.
xgettext.pl gives wrong ..%2\\$d.. with src code like "..%2$d.."
It works with single quotes
xgettext.pl gives right ..%2$d.. with src code like '..%2$d..'
but then std xgettext dont work
(need "" until perl is natively supported by xgettext)
BTW I join a (very) simple patch for xgettext.pl to recognize
the std form gettext() and not only _().
(patch for rev #22 Change: 7746 2003/08/28 10:18:18)
BTW: The new "xgettext --lang=perl" will extract *all* kinds of strings
Native xgettext Perl support, exactly what I was looking for :)
Thanks, but...
I got the latest CVS snapshot of GNU gettext via savannah.gnu.org with
cvs -z3 -d :pserver:anoncvs(_at_)sources(_dot_)redhat(_dot_)com:/cvs/gettext co
gettext
but it seems the added Perl support for xgettext is not there :(
$ ./xgettext --lang=perl /path/to/file.pl
xgettext: language `perl' unknown
... and in xgettext.c extension_to_language() I only see
/* Here will follow more file extensions: sh, pl ... */
Am I missing something ? (wrong cvs server?)
Christophe
--- /usr/bin/xgettext.pl 2003-09-30 16:02:34.000000000 +0200
+++ xgettext.pl 2003-10-06 15:36:27.000000000 +0200
@@ -182,7 +182,7 @@
my $line = $orig - (() = ((my $__ = $_) =~ /\n/g));
# maketext or loc or _
$state == NUL &&
- m/\b(translate|maketext|__?|loc|x)/gcx && do { $state = BEG; redo; };
+ m/\b(translate|maketext|gettext|__?|loc|x)/gcx && do { $state = BEG;
redo; };
$state == BEG && m/^([\s\t\n]*)/gcx && do { redo; };
# begin ()
$state == BEG && m/^([\S\(]) /gcx && do {