Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-8
1 #! /bin/sh
2
3 # Test -j option with charset conversion from ISO-8859-1 to UTF-8.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles xg-test8.po"
9 cat <<\EOF > xg-test8.po
10 # SOME DESCRIPTIVE TITLE.
11 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
12 # This file is distributed under the same license as the PACKAGE package.
13 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
14 #
15 #, fuzzy
16 msgid ""
17 msgstr ""
18 "Project-Id-Version: PACKAGE VERSION\n"
19 "Report-Msgid-Bugs-To: \n"
20 "POT-Creation-Date: 2004-10-22 12:39+0200\n"
21 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
22 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
23 "Language-Team: LANGUAGE <LL@li.org>\n"
24 "MIME-Version: 1.0\n"
25 "Content-Type: text/plain; charset=ISO-8859-1\n"
26 "Content-Transfer-Encoding: 8bit\n"
27
28 #: fifo.c:4
29 msgid "@(#)fifo.c\t1.56 04/10/10 Copyright 1989, 1994-2003 Jörg Schilling"
30 msgstr "ö"
31 EOF
32
33 tmpfiles="$tmpfiles xg-test8.in.c"
34 cat <<EOF > xg-test8.in.c
35 _("extract me")
36 EOF
37
38 : ${XGETTEXT=xgettext}
39 ${XGETTEXT} -a -j -o xg-test8.po xg-test8.in.c
40 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
41
42 tmpfiles="$tmpfiles xg-test8.pot"
43 sed -e '/POT-Creation-Date/d' < xg-test8.po | LC_ALL=C tr -d '\r' > xg-test8.pot
44
45 tmpfiles="$tmpfiles xg-test8.ok"
46 cat <<\EOF > xg-test8.ok
47 # SOME DESCRIPTIVE TITLE.
48 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
49 # This file is distributed under the same license as the PACKAGE package.
50 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
51 #
52 #, fuzzy
53 msgid ""
54 msgstr ""
55 "Project-Id-Version: PACKAGE VERSION\n"
56 "Report-Msgid-Bugs-To: \n"
57 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
58 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
59 "Language-Team: LANGUAGE <LL@li.org>\n"
60 "Language: \n"
61 "MIME-Version: 1.0\n"
62 "Content-Type: text/plain; charset=UTF-8\n"
63 "Content-Transfer-Encoding: 8bit\n"
64
65 #: fifo.c:4
66 msgid "@(#)fifo.c\t1.56 04/10/10 Copyright 1989, 1994-2003 Jörg Schilling"
67 msgstr "ö"
68
69 #: xg-test8.in.c:1
70 msgid "extract me"
71 msgstr ""
72 EOF
73
74 : ${DIFF=diff}
75 ${DIFF} xg-test8.ok xg-test8.pot
76 result=$?
77
78 rm -fr $tmpfiles
79
80 exit $result