No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / xgettext-python-2
blob88d9b9d5b20437c8e2efb85ec9d416d0626456ba
1 #!/bin/sh
3 # Test Python support: --add-comments option.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles xg-py-2.py"
9 cat <<EOF > xg-py-2.py
10 # This comment will not be extracted.
11 print gettext.gettext("help")
12 # TRANSLATORS: This is an extracted comment.
13 print gettext.gettext("me")
14 # Not extracted either.
15 print gettext.gettext("Hey Jude")
16 # TRANSLATORS:
17 # Nickname of the Beatles
18 print gettext.gettext("The Fabulous Four")
19 # TRANSLATORS: The strings get concatenated.
20 print gettext.gettext("there is not enough"
21 " room on a single line for this entire long, " # confusing, eh?
22 "verbose string")
23 EOF
25 tmpfiles="$tmpfiles xg-py-2.po"
26 : ${XGETTEXT=xgettext}
27 ${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
28 xg-py-2.py -d xg-py-2
29 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
31 tmpfiles="$tmpfiles xg-py-2.ok"
32 cat <<EOF > xg-py-2.ok
33 msgid "help"
34 msgstr ""
36 #. TRANSLATORS: This is an extracted comment.
37 msgid "me"
38 msgstr ""
40 msgid "Hey Jude"
41 msgstr ""
43 #. TRANSLATORS:
44 #. Nickname of the Beatles
45 msgid "The Fabulous Four"
46 msgstr ""
48 #. TRANSLATORS: The strings get concatenated.
49 msgid ""
50 "there is not enough room on a single line for this entire long, verbose "
51 "string"
52 msgstr ""
53 EOF
55 : ${DIFF=diff}
56 ${DIFF} xg-py-2.ok xg-py-2.po
57 result=$?
59 rm -fr $tmpfiles
61 exit $result