Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgcat-3
1 #! /bin/sh
2
3 # Test handling of input files with different charsets.
4 # 1. ISO-8859-1, 2. UTF-8; plus --use-first
5
6 tmpfiles=""
7 trap 'rm -fr $tmpfiles' 1 2 3 15
8
9 tmpfiles="$tmpfiles mcat-test3.in1 mcat-test3.in2"
10 cat <<\EOF > mcat-test3.in1
11 # German message file for xyz.
12 # Copyright (C) 1999, 2000, 2001 xyz.
13 # Kab Def <ke@zzz.uucp>, 2000.
14 #
15 msgid ""
16 msgstr ""
17 "Project-Id-Version: xyz\n"
18 "POT-Creation-Date: 2001-04-24 12:51:34+0200\n"
19 "PO-Revision-Date: 2001-04-24 13:02+02:00\n"
20 "Last-Translator: Kab Def <ke@zzz.uucp>\n"
21 "Language-Team: German <i18n@zzz.uucp>\n"
22 "MIME-Version: 1.0\n"
23 "Content-Type: text/plain; charset=ISO-8859-1\n"
24 "Content-Transfer-Encoding: 8bit\n"
25
26 #. Help text (HTML-like) START
27 #: clients/inst_ask_config.ycp:119
28 msgid ""
29 "Congratulations!"
30 msgstr ""
31 "Glückwunsch!"
32 EOF
33
34 cat <<\EOF > mcat-test3.in2
35 # German message file for xyz.
36 # Copyright (C) 1999, 2000, 2001 xyz.
37 # Kab Def <ke@zzz.uucp>, 2000.
38 #
39 msgid ""
40 msgstr ""
41 "Project-Id-Version: xyz\n"
42 "POT-Creation-Date: 2001-04-24 12:51:34+0200\n"
43 "PO-Revision-Date: 2001-04-24 13:02+02:00\n"
44 "Last-Translator: Kab Def <ke@zzz.uucp>\n"
45 "Language-Team: German <i18n@zzz.uucp>\n"
46 "MIME-Version: 1.0\n"
47 "Content-Type: text/plain; charset=UTF-8\n"
48 "Content-Transfer-Encoding: 8bit\n"
49
50 #. Remind user of the login name he chose
51 #: clients/inst_ask_config.ycp:72
52 #, ycp-format
53 msgid "You can log in as \"%1\"."
54 msgstr "Sie können sich als \"%1\" einloggen."
55 EOF
56
57 tmpfiles="$tmpfiles mcat-test3.tmp mcat-test3.err mcat-test3.out"
58 rm -f mcat-test3.tmp
59
60 : ${MSGCAT=msgcat}
61 LC_MESSAGES=C LC_ALL= \
62 ${MSGCAT} --use-first --more-than=0 -o mcat-test3.tmp \
63     mcat-test3.in1 mcat-test3.in2 >mcat-test3.err 2>&1
64 result=$?
65 cat mcat-test3.err | grep -v 'warning: .* encodings' | grep -v '^ '
66 test $result = 0 || { rm -fr $tmpfiles; exit 1; }
67 LC_ALL=C tr -d '\r' < mcat-test3.tmp > mcat-test3.out
68 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
69
70 tmpfiles="$tmpfiles mcat-test3.ok"
71 cat << \EOF > mcat-test3.ok
72 # German message file for xyz.
73 # Copyright (C) 1999, 2000, 2001 xyz.
74 # Kab Def <ke@zzz.uucp>, 2000.
75 #
76 msgid ""
77 msgstr ""
78 "Project-Id-Version: xyz\n"
79 "POT-Creation-Date: 2001-04-24 12:51:34+0200\n"
80 "PO-Revision-Date: 2001-04-24 13:02+02:00\n"
81 "Last-Translator: Kab Def <ke@zzz.uucp>\n"
82 "Language-Team: German <i18n@zzz.uucp>\n"
83 "MIME-Version: 1.0\n"
84 "Content-Type: text/plain; charset=UTF-8\n"
85 "Content-Transfer-Encoding: 8bit\n"
86
87 #. Help text (HTML-like) START
88 #: clients/inst_ask_config.ycp:119
89 msgid "Congratulations!"
90 msgstr "Glückwunsch!"
91
92 #. Remind user of the login name he chose
93 #: clients/inst_ask_config.ycp:72
94 #, ycp-format
95 msgid "You can log in as \"%1\"."
96 msgstr "Sie können sich als \"%1\" einloggen."
97 EOF
98
99 : ${DIFF=diff}
100 ${DIFF} mcat-test3.ok mcat-test3.out
101 result=$?
102
103 rm -fr $tmpfiles
104
105 exit $result