bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xgettext fails to process PHP files if a comment contains <%>


From: David Robinson
Subject: xgettext fails to process PHP files if a comment contains <%>
Date: Sat, 16 Oct 2021 14:35:48 -0500

I'm using  <% some_tag %> in PHP comments as a template string to
later search and replace with version or author information. When
running xgettext against code with this in a comment, it fails to
generate a pot file. After some trial and error, the smallest string
that will cause the failure is <%>

$ xgettext --version
xgettext (GNU gettext-tools) 0.19.8.1

xgettext -LPHP -o test.pot text.php

This PHP code will not generate a pot file,

<?php
//<%>
_("Text to grab.");
?>

This code will generate a proper pot file.

<?php
//<%
_("Text to grab.");
?>

Is there something significant about <% in gettext or is this a bug?
Changing the templates to <! !> or <@ @> works fine.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]