php-gettext / PHP-Scanner

PHP code scanner for gettext
MIT License
14 stars 5 forks source link

Comment extraction not working in certain cases #8

Closed lbarbula closed 4 years ago

lbarbula commented 4 years ago

Trying to leverage the comment extraction functionality of the PhpScanner class. I am having a hard time getting anything except in the simplest of cases.
Working:

//Translators: foo
gettext('bar');
//Translators: bar
echo gettext('foo');

Not Working:

//Translators: foo
$foo = gettext('foo');
//Translators: bar
$bar = sprintf(_('bar %s', 'foo'));
oscarotero commented 4 years ago

I just commited some changes to include comments from variable assigments. Could you test it? Thanks

lbarbula commented 4 years ago

@oscarotero that seems to do the trick!

lbarbula commented 4 years ago

Do you have an estimation on the next release with these updates?

oscarotero commented 4 years ago

Yes, it's already released: https://github.com/php-gettext/PHP-Scanner/releases/tag/v1.2.0 😄

lbarbula commented 4 years ago

You are worth your weight in gold, thank you very much!