bugGNU gettext - Bugs: bug #27740, Feature Request: Support Here Doc...


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

bug #27740: Feature Request: Support Here Doc & Now Doc syntaxes for PHP in xgettext

Submitted by:  None
Submitted on:  Sun 18 Oct 2009 12:35:27 AM UTC  
Votes:  100  
Category:  PHP Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Mon 06 Nov 2017 12:09:54 PM UTC, comment #5:


Daiki Ueno <ueno>
Project Administrator
Mon 06 Nov 2017 12:07:46 PM UTC, comment #4:

@ueno please reopen it as @canaaerus said this is about extracting the text inside a heredoc not about reading files with heredocs and no crashing.

Javier Alfonso Bellota de Frutos <phoneixs>
Mon 06 Nov 2017 12:04:01 PM UTC, comment #3:

Daiki Ueno

Javier Alfonso Bellota de Frutos <phoneixs>
Fri 23 Sep 2016 10:18:46 AM UTC, comment #2:

The bug referenced below (https://savannah.gnu.org/bugs/?41406) is only concerned with correctly parsing files using nowdoc, but not with extracting those nowdoc strings for translation.

At least my tests with xgettext version 0.19.7 show that heredoc text is not extracted, e.g.

Bodo Graumann <canaaerus>
Mon 10 Mar 2014 12:50:32 PM UTC, comment #1:

I think both syntaxes are now supported (see https://savannah.gnu.org/bugs/?41406). If it is not the case, please reopen.

Daiki Ueno <ueno>
Project Administrator
Sun 18 Oct 2009 12:35:27 AM UTC, original submission:


First of all, thanks a lot for this great piece of software, gettext really makes handling i18n issues easier.

I would like to request that support for the here doc/now doc syntax from PHP be added in xgettext. Currently, the PHP code scanner only support the single/double quote syntax. See http://fr.php.net/manual/en/language.types.string.php for more information on the different ways to define strings in PHP.

As far as I can tell, here documents should already be supported in the Shell code scanner (at least bash has support for them, not sure about other shells).

Here doc/now doc is a very useful syntax when you have to deal with very long embedded texts. It really improves code readability. I'm sure a lot of web developpers would be thankful for this addition.

Please keep up the good work



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 phoneixs (Posted a comment)
  • -email is unavailable- added by phoneixs (Voted in favor of this item)
  • -email is unavailable- added by canaaerus (Posted a comment)
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by haible (Updated the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 100 encouragements so far.

    Only logged-in users can vote.




    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-06 haible Assigned tohaible => None
    2017-11-06 ueno StatusFixed => None
        Open/ClosedClosed => Open
    2017-11-06 phoneixs Carbon-Copy- => Added phoneixs
    2016-11-27 haible CategoryNone => PHP
    2014-03-10 ueno StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2009-10-18 haible StatusNone => Confirmed
        Assigned toNone => haible

    Back to the top

    Powered by Savane 3.3