#!/bin/sh
tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15
tmpfiles="$tmpfiles xg-ph-1.php"
cat <<EOF > xg-ph-1.php
<?
// This comment will not be extracted.
echo _("help");
// TRANSLATORS: This is an extracted comment.
echo _("me");
echo _("and you");
/* Not extracted either. */
echo _("Hey Jude");
/* TRANSLATORS:
Nickname of the Beatles
*/
echo _("The Fabulous Four");
?>
EOF
tmpfiles="$tmpfiles xg-ph-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
xg-ph-1.php -d xg-ph-1
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tmpfiles="$tmpfiles xg-ph-1.ok"
cat <<EOF > xg-ph-1.ok
msgid "help"
msgstr ""
msgid "me"
msgstr ""
msgid "and you"
msgstr ""
msgid "Hey Jude"
msgstr ""
msgid "The Fabulous Four"
msgstr ""
EOF
: ${DIFF=diff}
${DIFF} xg-ph-1.ok xg-ph-1.po
result=$?
rm -fr $tmpfiles
exit $result