Skip to content

Comment extraction doesnt seem to work...? #6

@rgpublic

Description

@rgpublic

Is it just me or doesnt the comment extraction work with the new version? With the old version I think there was enableCommentsExtraction. With the new version there is no such method and the extraction also doesn't happen automatically it seems. I use this code for testing:

$translations=Translations::create();
$phpScanner=new PhpScanner($translations);
$php=<<<PHP
<?php
//I love comment extraction
echo gettext('hello world');
PHP;
$phpScanner->scanString($php,"hello.php");
print_r($translations);
exit;

$translation->extractedComments seems to be empty.

This feature was very useful for parsing the PHP compiled from Twig template files, because the compiled PHP code included the original line number in the Twig file so you get a kind of source-map feature where you can see where the real line of the respective translation was...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions