bug-gettext
[Top][All Lists]
Advanced

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

[bug-gettext] xgettext does not recognize PHP nowdoc syntax


From: Byrial Jensen
Subject: [bug-gettext] xgettext does not recognize PHP nowdoc syntax
Date: Tue, 03 Apr 2012 20:04:14 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120313 Thunderbird/11.0

xgettext does not recognize nowdoc syntax in PHP files. Nowdoc syntax is similar to heredoc syntax, but the identifier which follows <<< is enclosed in single quotes. (See the PHP manual: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc)

Test example:

$ cat test.php
<?PHP

$var1 = _('text 1');

$var2 = <<<'EOT'
text 2
EOT;

$var3 = _('text 3');

?>

$ xgettext test.php -o-
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <address@hidden>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-04-03 20:00+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <address@hidden>\n"
"Language-Team: LANGUAGE <address@hidden>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: test.php:3
msgid "text 1"
msgstr ""
$ LANG=C xgettext --version
xgettext (GNU gettext-tools) 0.18.1
Copyright (C) 1995-1998, 2000-2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ulrich Drepper.
$

In the example xgettext never finds text 3, presumably because it fails to see where text 2 ends.



reply via email to

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