bugGNU gettext - Bugs: bug #41406, xgettext fails to parse PHP files...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #41406: xgettext fails to parse PHP files that contain nowdocs (patch available)

Submitter:  None
Submitted:  Thu 30 Jan 2014 06:02:22 PM UTC
   
 
Category:  PHP Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  ueno
Open/Closed:  Closed

Mon 10 Mar 2014 12:47:44 PM UTC, comment #2: 
Daiki Ueno <ueno>
Group administrator
Fri 31 Jan 2014 03:12:27 AM UTC, comment #1: 

Thanks for reminding.  Looking at the manual, it seems that optional double quotes enclosing heredoc identifier was also added at the same time (PHP 5.3).  I'll merge the patch after adding support for it.

Daiki Ueno <ueno>
Group administrator
Thu 30 Jan 2014 06:02:22 PM UTC, original submission:  

xgettext's PHP parser correctly handles heredoc syntax:

$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;

But if it encounters the similar newdoc block, it fails:

$str = <<<'EOD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;

(Reference: http://www.php.net/manual/en/language.types.string.php)

This isn't about being able to extract translatable strings written as newdoc, that's fine as far as I am concerned. But if a PHP file contains a newdoc block, xgettext will not see anything below it, including ordinary _("strings like this").

Andreas Stricker posted a patch for this to bug-gettext in April 2012, but it seems it felt through the cracks:

http://lists.gnu.org/archive/html/bug-gettext/2012-04/msg00002.html

Would it be possible to apply it?

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by vslavik
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-11-27 haible CategoryNone PHP
    2014-03-10 ueno StatusNone Fixed
        Open/ClosedOpen Closed
    2014-01-31 ueno Assigned toNone ueno
    2014-01-30 vslavik Carbon-Copy- Added vslavik

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code