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