Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-5
1 #! /bin/sh
2
3 # Test extraction of non-ASCII msgids.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles xg-test5.c"
9 cat <<EOF > xg-test5.c
10 void foo (int option)
11 {
12   printf (_("%s: neznámý pøepínaè -- %c\n"), option);
13   printf (_("%s: pøepínaè vy¾aduje argument -- %c\n"), option);
14 }
15 EOF
16
17 tmpfiles="$tmpfiles xg-test5.tmp xg-test5.po"
18 : ${XGETTEXT=xgettext}
19 ${XGETTEXT} --no-location -k_ -o xg-test5.po xg-test5.c 2>/dev/null
20 test $? = 1 || { rm -fr $tmpfiles; exit 1; }
21 ${XGETTEXT} --no-location -k_ --from-code=iso-8859-2 -o xg-test5.tmp xg-test5.c
22 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
23 LC_ALL=C tr -d '\r' < xg-test5.tmp > xg-test5.po
24 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
25
26 tmpfiles="$tmpfiles xg-test5.pot"
27 sed -e '/POT-Creation-Date/d' < xg-test5.po > xg-test5.pot
28
29 tmpfiles="$tmpfiles xg-test5.ok"
30 cat <<EOF > xg-test5.ok
31 # SOME DESCRIPTIVE TITLE.
32 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33 # This file is distributed under the same license as the PACKAGE package.
34 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
35 #
36 #, fuzzy
37 msgid ""
38 msgstr ""
39 "Project-Id-Version: PACKAGE VERSION\n"
40 "Report-Msgid-Bugs-To: \n"
41 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
42 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
43 "Language-Team: LANGUAGE <LL@li.org>\n"
44 "Language: \n"
45 "MIME-Version: 1.0\n"
46 "Content-Type: text/plain; charset=UTF-8\n"
47 "Content-Transfer-Encoding: 8bit\n"
48
49 #, c-format
50 msgid "%s: neznámý přepínač -- %c\n"
51 msgstr ""
52
53 #, c-format
54 msgid "%s: přepínač vyžaduje argument -- %c\n"
55 msgstr ""
56 EOF
57
58 : ${DIFF=diff}
59 ${DIFF} xg-test5.ok xg-test5.pot
60 result=$?
61
62 rm -fr $tmpfiles
63
64 exit $result