Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-24
1 #! /bin/sh
2
3 # Test msgmerge and msgcmp: handling of 'range:' flags.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles mm-test24.po"
9 cat <<\EOF > mm-test24.po
10 msgid ""
11 msgstr ""
12 "Content-Type: text/plain; charset=UTF-8\n"
13 "Content-Transfer-Encoding: 8bit\n"
14
15 #, c-format
16 msgid "one day"
17 msgid_plural "%d days"
18 msgstr[0] "un jour"
19 msgstr[1] "%d jours"
20
21 #, c-format, range: 1..6
22 msgid "one week and one day"
23 msgid_plural "one week and %d days"
24 msgstr[0] "une semaine et un jour"
25 msgstr[1] "une semaine et %d jours"
26
27 #, c-format, range: 1..7
28 msgid "two weeks and one day"
29 msgid_plural "two weeks and %d days"
30 msgstr[0] "deux semaines et un jour"
31 msgstr[1] "deux semaines et %d jours"
32
33 #, c-format, range: 0..6
34 msgid "three weeks and one day"
35 msgid_plural "three weeks and %d days"
36 msgstr[0] "trois semaines et un jour"
37 msgstr[1] "trois semaines et %d jours"
38
39 #, c-format, range: 0..7
40 msgid "four weeks and one day"
41 msgid_plural "four weeks and %d days"
42 msgstr[0] "quatre semaines et un jour"
43 msgstr[1] "quatre semaines et %d jours"
44
45 #, c-format, range: 1..6
46 msgid "five weeks and one day"
47 msgid_plural "five weeks and %d days"
48 msgstr[0] "cinq semaines et un jour"
49 msgstr[1] "cinq semaines et %d jours"
50 EOF
51
52 tmpfiles="$tmpfiles mm-test24.pot"
53 cat <<\EOF > mm-test24.pot
54 # SOME DESCRIPTIVE TITLE.
55 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
56 # This file is distributed under the same license as the PACKAGE package.
57 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
58 #
59 #, fuzzy
60 msgid ""
61 msgstr ""
62 "Project-Id-Version: PACKAGE VERSION\n"
63 "Report-Msgid-Bugs-To: \n"
64 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
65 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
66 "Language-Team: LANGUAGE <LL@li.org>\n"
67 "MIME-Version: 1.0\n"
68 "Content-Type: text/plain; charset=UTF-8\n"
69 "Content-Transfer-Encoding: 8bit\n"
70
71 #, c-format, range: 1..6
72 msgid "one day"
73 msgid_plural "%d days"
74 msgstr[0] ""
75 msgstr[1] ""
76
77 #, c-format
78 msgid "one week and one day"
79 msgid_plural "one week and %d days"
80 msgstr[0] ""
81 msgstr[1] ""
82
83 #, c-format, range: 0..6
84 msgid "two weeks and one day"
85 msgid_plural "two weeks and %d days"
86 msgstr[0] ""
87 msgstr[1] ""
88
89 #, c-format, range: 1..7
90 msgid "three weeks and one day"
91 msgid_plural "three weeks and %d days"
92 msgstr[0] ""
93 msgstr[1] ""
94
95 #, c-format, range: 1..6
96 msgid "four weeks and one day"
97 msgid_plural "four weeks and %d days"
98 msgstr[0] ""
99 msgstr[1] ""
100
101 #, c-format, range: 0..7
102 msgid "five weeks and one day"
103 msgid_plural "five weeks and %d days"
104 msgstr[0] ""
105 msgstr[1] ""
106 EOF
107
108 : ${MSGCMP=msgcmp}
109 ${MSGCMP} --use-fuzzy --use-untranslated mm-test24.po mm-test24.pot 2>/dev/null
110 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
111
112 tmpfiles="$tmpfiles mm-test24.tmp.po mm-test24.new.po"
113 : ${MSGMERGE=msgmerge}
114 ${MSGMERGE} -q -o mm-test24.tmp.po mm-test24.po mm-test24.pot
115 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
116 LC_ALL=C tr -d '\r' < mm-test24.tmp.po > mm-test24.new.po
117 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
118
119 tmpfiles="$tmpfiles mm-test24.ok"
120 cat <<\EOF > mm-test24.ok
121 msgid ""
122 msgstr ""
123 "Report-Msgid-Bugs-To: \n"
124 "Content-Type: text/plain; charset=UTF-8\n"
125 "Content-Transfer-Encoding: 8bit\n"
126
127 #, c-format, range: 1..6
128 msgid "one day"
129 msgid_plural "%d days"
130 msgstr[0] "un jour"
131 msgstr[1] "%d jours"
132
133 #, fuzzy, c-format
134 msgid "one week and one day"
135 msgid_plural "one week and %d days"
136 msgstr[0] "une semaine et un jour"
137 msgstr[1] "une semaine et %d jours"
138
139 #, fuzzy, c-format, range: 0..6
140 msgid "two weeks and one day"
141 msgid_plural "two weeks and %d days"
142 msgstr[0] "deux semaines et un jour"
143 msgstr[1] "deux semaines et %d jours"
144
145 #, fuzzy, c-format, range: 1..7
146 msgid "three weeks and one day"
147 msgid_plural "three weeks and %d days"
148 msgstr[0] "trois semaines et un jour"
149 msgstr[1] "trois semaines et %d jours"
150
151 #, c-format, range: 1..6
152 msgid "four weeks and one day"
153 msgid_plural "four weeks and %d days"
154 msgstr[0] "quatre semaines et un jour"
155 msgstr[1] "quatre semaines et %d jours"
156
157 #, fuzzy, c-format, range: 0..7
158 msgid "five weeks and one day"
159 msgid_plural "five weeks and %d days"
160 msgstr[0] "cinq semaines et un jour"
161 msgstr[1] "cinq semaines et %d jours"
162 EOF
163
164 : ${DIFF=diff}
165 ${DIFF} mm-test24.ok mm-test24.new.po
166 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
167
168 : ${MSGCMP=msgcmp}
169 ${MSGCMP} --use-fuzzy --use-untranslated mm-test24.new.po mm-test24.pot
170 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
171
172 rm -fr $tmpfiles
173
174 exit 0