If you would like to create a .po file with include heredoc scripts inside curly brackets {} solution is as follows;
I want to translate what in here (test.php):
<code>
<?php
$EOF = <<<EOF
{$t->__('I want to translate this string.')}
EOF;
?>
</code>
You will have to use the xgettext (gnu utility) with the Python parser like so:
<code>
$ xgettext --default-domain=test --keyword=__ --keyword --language=Python test.php
</code>
The above terminal command might seem wrong with --keyword used twice, this is however correct.