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