[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gettext + PHP
From: |
Jonas Koch Bentzen |
Subject: |
gettext + PHP |
Date: |
Fri, 21 Jun 2002 23:11:30 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 |
Hi,
This is not a bug, but I didn't really know which email address to write
to... It would be great if xgettext could parse PHP files. In PHP files
xgettext extracts all strings, a lot of which are not really strings to
be translated. An example:
<?php
require("some/file.php");
set_error_handler("error");
if ("string" == $something) {
echo gettext("Some text");
}
?>
In this case, xgettext extracts the following strings:
"some/file.php"
"error"
"string"
"Some text"
It should only extract the last one. All strings to be translated are
encapsulated inside the function "gettext()" (which has an alias named
"_()". In other words, xgettext should extract text from the functions
in the following example:
gettext("Here's a string.");
_("Here's a string");
gettext('Here's another string');
_("And yet another one - this time with %s");
Hope you'll consider making that improvement : ) Thanks for making such
a great program.
- Jonas Koch Bentzen
- gettext + PHP,
Jonas Koch Bentzen <=