Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-7
1 #! /bin/sh
2
3 # Test multi-domain handling.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles mm-test7.po"
9 cat <<\EOF > mm-test7.po
10 domain "foo-de"
11 msgid ""
12 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
13
14 # Das ist ein Kommentar.
15 msgid "hello"
16 msgstr "Hallo"
17
18 # Noch einer.
19 msgid "bye"
20 msgstr "Tschüß"
21
22 domain "foo-fr"
23 msgid ""
24 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
25
26 # Ceci est un commentaire.
27 msgid "hello"
28 msgstr "Salut"
29
30 # Encore un.
31 msgid "bye"
32 msgstr "A bientôt"
33 EOF
34
35 tmpfiles="$tmpfiles mm-test7.pot"
36 cat <<EOF > mm-test7.pot
37 domain "foo-de"
38 msgid "Hello"
39 msgstr ""
40 domain "foo-fr"
41 msgid "Hello"
42 msgstr ""
43 EOF
44
45 tmpfiles="$tmpfiles mm-test7.tmp mm-test7.out"
46 : ${MSGMERGE=msgmerge}
47 ${MSGMERGE} -q -o mm-test7.tmp mm-test7.po mm-test7.pot
48 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
49 LC_ALL=C tr -d '\r' < mm-test7.tmp > mm-test7.out
50 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
51
52 tmpfiles="$tmpfiles mm-test7.ok"
53 cat <<\EOF > mm-test7.ok
54 domain "foo-de"
55
56 msgid ""
57 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
58
59 # Das ist ein Kommentar.
60 #, fuzzy
61 msgid "Hello"
62 msgstr "Hallo"
63
64 # Noch einer.
65 #~ msgid "bye"
66 #~ msgstr "Tschüß"
67
68 domain "foo-fr"
69
70 msgid ""
71 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
72
73 # Ceci est un commentaire.
74 #, fuzzy
75 msgid "Hello"
76 msgstr "Salut"
77
78 # Encore un.
79 #~ msgid "bye"
80 #~ msgstr "A bientôt"
81 EOF
82
83 : ${DIFF=diff}
84 ${DIFF} mm-test7.ok mm-test7.out
85 result=$?
86
87 rm -fr $tmpfiles
88
89 exit $result