As default, xgettext ignores any keyword found within a comment block.
<?php // file.php
echo _('This text will be found');
//_('This text will be ignored');
Is it possible to override this behaviour? I've tried by adding //_
as a keyword, but this fails as well. It seems comments have priority over keywords:
xgettext -o output.po --language=PHP -k_ -k//_ file.php
Thanks for help!
It seems, that xgettext filters out comments and i do not know of a way to avoid this. However, as an alternative solution you could just use sed to replace comments before feeding the file to xgettext:
sed 's/\/\/_/_/g' file.php | xgettext -o output.po --language=PHP -