3 # Test PHP support: --add-comments option.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles xg-ph-1.php"
9 cat <<EOF > xg-ph-1.php
11 // This comment will not be extracted.
13 // TRANSLATORS: This is an extracted comment.
15 # TRANSLATORS: This is extracted too.
17 /* Not extracted either. */
20 Nickname of the Beatles
22 echo _("The Fabulous Four");
23 // This will not be extracted.
28 tmpfiles="$tmpfiles xg-ph-1.tmp.po xg-ph-1.po"
29 : ${XGETTEXT=xgettext}
30 ${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
31 -d xg-ph-1.tmp xg-ph-1.php
32 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
33 LC_ALL=C tr -d '\r' < xg-ph-1.tmp.po > xg-ph-1.po
34 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
36 tmpfiles="$tmpfiles xg-ph-1.ok"
37 cat <<EOF > xg-ph-1.ok
41 #. TRANSLATORS: This is an extracted comment.
45 #. TRANSLATORS: This is extracted too.
53 #. Nickname of the Beatles
55 msgid "The Fabulous Four"
60 ${DIFF} xg-ph-1.ok xg-ph-1.po