• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test msgmerge and msgcmp: handling of 'range:' flags.
5
6cat <<\EOF > mm-test24.po
7msgid ""
8msgstr ""
9"Content-Type: text/plain; charset=UTF-8\n"
10"Content-Transfer-Encoding: 8bit\n"
11
12#, c-format
13msgid "one day"
14msgid_plural "%d days"
15msgstr[0] "un jour"
16msgstr[1] "%d jours"
17
18#, c-format, range: 1..6
19msgid "one week and one day"
20msgid_plural "one week and %d days"
21msgstr[0] "une semaine et un jour"
22msgstr[1] "une semaine et %d jours"
23
24#, c-format, range: 1..7
25msgid "two weeks and one day"
26msgid_plural "two weeks and %d days"
27msgstr[0] "deux semaines et un jour"
28msgstr[1] "deux semaines et %d jours"
29
30#, c-format, range: 0..6
31msgid "three weeks and one day"
32msgid_plural "three weeks and %d days"
33msgstr[0] "trois semaines et un jour"
34msgstr[1] "trois semaines et %d jours"
35
36#, c-format, range: 0..7
37msgid "four weeks and one day"
38msgid_plural "four weeks and %d days"
39msgstr[0] "quatre semaines et un jour"
40msgstr[1] "quatre semaines et %d jours"
41
42#, c-format, range: 1..6
43msgid "five weeks and one day"
44msgid_plural "five weeks and %d days"
45msgstr[0] "cinq semaines et un jour"
46msgstr[1] "cinq semaines et %d jours"
47EOF
48
49cat <<\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
56msgid ""
57msgstr ""
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
68msgid "one day"
69msgid_plural "%d days"
70msgstr[0] ""
71msgstr[1] ""
72
73#, c-format
74msgid "one week and one day"
75msgid_plural "one week and %d days"
76msgstr[0] ""
77msgstr[1] ""
78
79#, c-format, range: 0..6
80msgid "two weeks and one day"
81msgid_plural "two weeks and %d days"
82msgstr[0] ""
83msgstr[1] ""
84
85#, c-format, range: 1..7
86msgid "three weeks and one day"
87msgid_plural "three weeks and %d days"
88msgstr[0] ""
89msgstr[1] ""
90
91#, c-format, range: 1..6
92msgid "four weeks and one day"
93msgid_plural "four weeks and %d days"
94msgstr[0] ""
95msgstr[1] ""
96
97#, c-format, range: 0..7
98msgid "five weeks and one day"
99msgid_plural "five weeks and %d days"
100msgstr[0] ""
101msgstr[1] ""
102EOF
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
109LC_ALL=C tr -d '\r' < mm-test24.tmp.po > mm-test24.new.po || Exit 1
110
111cat <<\EOF > mm-test24.ok
112msgid ""
113msgstr ""
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
119msgid "one day"
120msgid_plural "%d days"
121msgstr[0] "un jour"
122msgstr[1] "%d jours"
123
124#, fuzzy, c-format
125msgid "one week and one day"
126msgid_plural "one week and %d days"
127msgstr[0] "une semaine et un jour"
128msgstr[1] "une semaine et %d jours"
129
130#, fuzzy, c-format, range: 0..6
131msgid "two weeks and one day"
132msgid_plural "two weeks and %d days"
133msgstr[0] "deux semaines et un jour"
134msgstr[1] "deux semaines et %d jours"
135
136#, fuzzy, c-format, range: 1..7
137msgid "three weeks and one day"
138msgid_plural "three weeks and %d days"
139msgstr[0] "trois semaines et un jour"
140msgstr[1] "trois semaines et %d jours"
141
142#, c-format, range: 1..6
143msgid "four weeks and one day"
144msgid_plural "four weeks and %d days"
145msgstr[0] "quatre semaines et un jour"
146msgstr[1] "quatre semaines et %d jours"
147
148#, fuzzy, c-format, range: 0..7
149msgid "five weeks and one day"
150msgid_plural "five weeks and %d days"
151msgstr[0] "cinq semaines et un jour"
152msgstr[1] "cinq semaines et %d jours"
153EOF
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
161Exit 0
162