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

Submitter:  None
Submitted:  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: 

Reopening.

Daiki Ueno <ueno>
Group 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.

<?php

echo 'Test1';

echo _('Test2');

echo _(<<<TEST
Test3
TEST
);

echo <<<TEST
_(Test4)
TEST;

?>


processed with +verbatim+xgettext test.php -o test.pot -L PHP-verbatim- only extracts Test2.

This feature (Test3) would be really useful.

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>
Group administrator
Sun 18 Oct 2009 12:35:27 AM UTC, original submission:  

Hello,

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

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 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)
  •  

    There are 100 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 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.13-f8d8.
    Corresponding source code