No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / xgettext-php-1
blob2ba6f5a6f86bbc9b969de97d9e58ebce6c98e95c
1 #!/bin/sh
3 # Test PHP support: --add-comments option.
5 tmpfiles=""
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.
12 echo _("help");
13 // TRANSLATORS: This is an extracted comment.
14 echo _("me");
15 # TRANSLATORS: This is extracted too.
16 echo _("and you");
17 /* Not extracted either. */
18 echo _("Hey Jude");
19 /* TRANSLATORS:
20 Nickname of the Beatles
22 echo _("The Fabulous Four");
24 EOF
26 tmpfiles="$tmpfiles xg-ph-1.po"
27 : ${XGETTEXT=xgettext}
28 ${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
29 xg-ph-1.php -d xg-ph-1
30 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
32 tmpfiles="$tmpfiles xg-ph-1.ok"
33 cat <<EOF > xg-ph-1.ok
34 msgid "help"
35 msgstr ""
37 #. TRANSLATORS: This is an extracted comment.
38 msgid "me"
39 msgstr ""
41 #. TRANSLATORS: This is extracted too.
42 msgid "and you"
43 msgstr ""
45 msgid "Hey Jude"
46 msgstr ""
48 #. TRANSLATORS:
49 #. Nickname of the Beatles
51 msgid "The Fabulous Four"
52 msgstr ""
53 EOF
55 : ${DIFF=diff}
56 ${DIFF} xg-ph-1.ok xg-ph-1.po
57 result=$?
59 rm -fr $tmpfiles
61 exit $result