xgettext-python-1 revision 1.1 1 1.1 christos #!/bin/sh
2 1.1 christos
3 1.1 christos # Test of Python support.
4 1.1 christos
5 1.1 christos tmpfiles=""
6 1.1 christos trap 'rm -fr $tmpfiles' 1 2 3 15
7 1.1 christos
8 1.1 christos tmpfiles="$tmpfiles xg-py-1.py"
9 1.1 christos cat <<\EOF > xg-py-1.py
10 1.1 christos # interpret_ansic = true, interpret_unicode = false
11 1.1 christos _("abc\
12 1.1 christos \\def\'ghi\"jkl\a\b\f\n\r\t\v x\040x\x7ey\u0142\U00010123\N{LATIN SMALL LETTER Z}");
13 1.1 christos
14 1.1 christos # interpret_ansic = false, interpret_unicode = false
15 1.1 christos _(r"abc\
16 1.1 christos \\def\'ghi\"jkl\a\b\f\n\r\t\v x\040x\x7ey\u0142\U00010123\N{LATIN SMALL LETTER Z}");
17 1.1 christos
18 1.1 christos # interpret_ansic = true, interpret_unicode = true
19 1.1 christos _(u"abc\
20 1.1 christos \\def\'ghi\"jkl\a\b\f\n\r\t\v x\040x\x7ey\u0142\U00010123\N{LATIN SMALL LETTER Z}");
21 1.1 christos
22 1.1 christos # interpret_ansic = false, interpret_unicode = true
23 1.1 christos _(ur"abc\
24 1.1 christos \\def\'ghi\"jkl\a\b\f\n\r\t\v x\040x\x7ey\u0142\U00010123\N{LATIN SMALL LETTER Z}");
25 1.1 christos EOF
26 1.1 christos
27 1.1 christos tmpfiles="$tmpfiles xg-py-1.err xg-py-1.tmp xg-py-1.pot"
28 1.1 christos : ${XGETTEXT=xgettext}
29 1.1 christos ${XGETTEXT} --add-comments --no-location -o xg-py-1.tmp xg-py-1.py 2>xg-py-1.err
30 1.1 christos test $? = 0 || { cat xg-py-1.err; rm -fr $tmpfiles; exit 1; }
31 1.1 christos grep -v 'POT-Creation-Date' < xg-py-1.tmp > xg-py-1.pot
32 1.1 christos
33 1.1 christos tmpfiles="$tmpfiles xg-py-1.ok"
34 1.1 christos cat <<\EOF > xg-py-1.ok
35 1.1 christos # SOME DESCRIPTIVE TITLE.
36 1.1 christos # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
37 1.1 christos # This file is distributed under the same license as the PACKAGE package.
38 1.1 christos # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
39 1.1 christos #
40 1.1 christos #, fuzzy
41 1.1 christos msgid ""
42 1.1 christos msgstr ""
43 1.1 christos "Project-Id-Version: PACKAGE VERSION\n"
44 1.1 christos "Report-Msgid-Bugs-To: \n"
45 1.1 christos "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
46 1.1 christos "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
47 1.1 christos "Language-Team: LANGUAGE <LL (at] li.org>\n"
48 1.1 christos "MIME-Version: 1.0\n"
49 1.1 christos "Content-Type: text/plain; charset=UTF-8\n"
50 1.1 christos "Content-Transfer-Encoding: 8bit\n"
51 1.1 christos
52 1.1 christos #. interpret_ansic = true, interpret_unicode = false
53 1.1 christos msgid ""
54 1.1 christos "abc\\def'ghi\"jkl\a\b\f\n"
55 1.1 christos "\r\t\v x x~y\\u0142\\U00010123\\N{LATIN SMALL LETTER Z}"
56 1.1 christos msgstr ""
57 1.1 christos
58 1.1 christos #. interpret_ansic = false, interpret_unicode = false
59 1.1 christos msgid ""
60 1.1 christos "abc\\\n"
61 1.1 christos "\\\\def\\'ghi\\\"jkl\\a\\b\\f\\n\\r\\t\\v x\\040x\\x7ey\\u0142\\U00010123\\N"
62 1.1 christos "{LATIN SMALL LETTER Z}"
63 1.1 christos msgstr ""
64 1.1 christos
65 1.1 christos #. interpret_ansic = true, interpret_unicode = true
66 1.1 christos msgid ""
67 1.1 christos "abc\\def'ghi\"jkl\a\b\f\n"
68 1.1 christos "\r\t\v x x~yz"
69 1.1 christos msgstr ""
70 1.1 christos
71 1.1 christos #. interpret_ansic = false, interpret_unicode = true
72 1.1 christos msgid ""
73 1.1 christos "abc\\\n"
74 1.1 christos "\\\\def\\'ghi\\\"jkl\\a\\b\\f\\n\\r\\t\\v x\\040x\\x7ey\\U00010123\\N{LATIN "
75 1.1 christos "SMALL LETTER Z}"
76 1.1 christos msgstr ""
77 1.1 christos EOF
78 1.1 christos
79 1.1 christos : ${DIFF=diff}
80 1.1 christos ${DIFF} xg-py-1.ok xg-py-1.pot
81 1.1 christos result=$?
82 1.1 christos
83 1.1 christos rm -fr $tmpfiles
84 1.1 christos
85 1.1 christos exit $result
86