Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-23
1 #! /bin/sh
2
3 # Test msgmerge when a msgid_plural changed but msgid remained the same,
4 # and --previous was specified.
5 # Reported by Chusslove Illich (Часлав Илић).
6
7 tmpfiles=""
8 trap 'rm -fr $tmpfiles' 1 2 3 15
9
10 tmpfiles="$tmpfiles mm-test23.po"
11 cat <<\EOF > mm-test23.po
12 msgid ""
13 msgstr ""
14 "Project-Id-Version: \n"
15 "Report-Msgid-Bugs-To: \n"
16 "POT-Creation-Date: 2008-01-13 16:59+0100\n"
17 "PO-Revision-Date: 2007-06-28 16:37+0200\n"
18 "Last-Translator: \n"
19 "Language-Team: \n"
20 "Language: de\n"
21 "MIME-Version: 1.0\n"
22 "Content-Type: text/plain; charset=UTF-8\n"
23 "Content-Transfer-Encoding: 8bit\n"
24 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
25
26 #, c-format
27 msgid "%n lines"
28 msgstr ""
29
30 #, c-format
31 msgid "%n areas"
32 msgstr "%n Flächen"
33
34 #, c-format
35 msgid "One object"
36 msgid_plural "%n objects"
37 msgstr[0] ""
38 msgstr[1] ""
39
40 #, c-format
41 msgid "One volume"
42 msgid_plural "%n volumes"
43 msgstr[0] "Ein Band"
44 msgstr[1] "%n Bände"
45 EOF
46
47 tmpfiles="$tmpfiles mm-test23.pot"
48 cat <<\EOF > mm-test23.pot
49 msgid ""
50 msgstr ""
51 "Project-Id-Version: \n"
52 "Report-Msgid-Bugs-To: \n"
53 "POT-Creation-Date: 2008-01-13 16:59+0100\n"
54 "PO-Revision-Date: 2007-06-28 16:37+0200\n"
55 "Last-Translator: \n"
56 "Language-Team: \n"
57 "Language: \n"
58 "MIME-Version: 1.0\n"
59 "Content-Type: text/plain; charset=UTF-8\n"
60 "Content-Transfer-Encoding: 8bit\n"
61
62 #, kde-format
63 msgid "%1 lines"
64 msgstr ""
65
66 #, kde-format
67 msgid "%1 areas"
68 msgstr ""
69
70 #, kde-format
71 msgid "One object"
72 msgid_plural "%1 objects"
73 msgstr[0] ""
74 msgstr[1] ""
75
76 #, kde-format
77 msgid "One volume"
78 msgid_plural "%1 volumes"
79 msgstr[0] ""
80 msgstr[1] ""
81 EOF
82
83 tmpfiles="$tmpfiles mm-test23.tmp.po mm-test23.new.po"
84 : ${MSGMERGE=msgmerge}
85 ${MSGMERGE} -q --previous -o mm-test23.tmp.po mm-test23.po mm-test23.pot
86 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
87 LC_ALL=C tr -d '\r' < mm-test23.tmp.po > mm-test23.new.po
88 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
89
90 tmpfiles="$tmpfiles mm-test23.ok"
91 cat <<\EOF > mm-test23.ok
92 msgid ""
93 msgstr ""
94 "Project-Id-Version: \n"
95 "Report-Msgid-Bugs-To: \n"
96 "POT-Creation-Date: 2008-01-13 16:59+0100\n"
97 "PO-Revision-Date: 2007-06-28 16:37+0200\n"
98 "Last-Translator: \n"
99 "Language-Team: \n"
100 "Language: de\n"
101 "MIME-Version: 1.0\n"
102 "Content-Type: text/plain; charset=UTF-8\n"
103 "Content-Transfer-Encoding: 8bit\n"
104 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
105
106 #, kde-format
107 msgid "%1 lines"
108 msgstr ""
109
110 #, fuzzy, kde-format
111 #| msgid "%n areas"
112 msgid "%1 areas"
113 msgstr "%n Flächen"
114
115 #, kde-format
116 msgid "One object"
117 msgid_plural "%1 objects"
118 msgstr[0] ""
119 msgstr[1] ""
120
121 #, fuzzy, kde-format
122 #| msgid "One volume"
123 #| msgid_plural "%n volumes"
124 msgid "One volume"
125 msgid_plural "%1 volumes"
126 msgstr[0] "Ein Band"
127 msgstr[1] "%n Bände"
128 EOF
129
130 : ${DIFF=diff}
131 ${DIFF} mm-test23.ok mm-test23.new.po
132 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
133
134 tmpfiles="$tmpfiles mm-test23.mo"
135 : ${MSGFMT=msgfmt}
136 ${MSGFMT} --check -o mm-test23.mo mm-test23.new.po
137 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
138
139 rm -fr $tmpfiles
140
141 exit 0