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  
Category: PHPSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

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
  • -unavailable- added by canaaerus (Posted a comment)
  • -unavailable- added by ueno (Posted a comment)
  • -unavailable- added by haible (Updated the item)

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

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 27 Nov 2016 12:26:36 AM UTChaibleCategoryNone=>PHP
    Mon 10 Mar 2014 12:50:32 PM UTCuenoStatusConfirmed=>Fixed
    Sun 18 Oct 2009 06:59:13 AM UTChaibleStatusNone=>Confirmed
      Assigned toNone=>haible

    Back to the top

    Powered by Savane 3.1-cleanup1