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