Subject: | xgettext doesn't handle interpolating functions |
I'm running perl-5.8.7 on Windows XP.
If I place the following in "foo.pm":
print loc('Source: %1 line %2', $self->file(), $self->line());
and then run "xgettext foo.pm" then I get a "messages.po" file containing the msgid/msgstr pair:
#: foo.pm:1
#. ($self->file()
msgid "Source: %1 line %2"
msgstr ""
I would have expected the above to be:
#: foo.pm:1
#. ($self->file(), $self->line())
msgid "Source: %1 line %2"
msgstr ""
The difference is only a comment, so it doesn't break anything, but it would be helpful if all the things being interpolated were correctly listed in the comment.
It seems to have got confused over the () syntax in the method call. If I change "foo.pm" to read:
print loc('Source: %1 line %2', $self->file, $self->line);
then I get the expected output:
#: foo.pm:1
#. ($self->file, $self->line)
msgid "Source: %1 line %2"
msgstr ""
Perhaps it sees the closing ")" in "$self->file()" as the end of the "loc(...)" expression?