1#! /bin/sh
2
3# Test compendium option.
4
5# Translation is available within the compendium (mm-c-3.com)
6# the old translation file (mm-c-3.in1) contains the same msgid
7# Why not make use of the translation from the compendium?
8
9tmpfiles=""
10trap 'rm -fr $tmpfiles' 1 2 3 15
11
12tmpfiles="$tmpfiles mm-c-3.in1 mm-c-3.com mm-c-3.pot"
13cat <<EOF > mm-c-3.in1
14#: file.c:123
15msgid "1"
16msgstr "1x"
17
18#: file.c:345
19msgid "one, two, three"
20msgstr ""
21EOF
22
23cat <<EOF > mm-c-3.com
24#: file.c:345
25msgid "one, two, three"
26msgstr "1, 2, 3"
27EOF
28
29cat <<EOF > mm-c-3.pot
30#: file.c:123
31msgid "1"
32msgstr ""
33
34#: file.c:345
35msgid "one, two, three"
36msgstr ""
37EOF
38
39tmpfiles="$tmpfiles mm-c-3.out"
40: ${MSGMERGE=msgmerge}
41${MSGMERGE} -q -C mm-c-3.com -o mm-c-3.out mm-c-3.in1 mm-c-3.pot
42test $? = 0 || { rm -fr $tmpfiles; exit 1; }
43
44tmpfiles="$tmpfiles mm-c-3.ok"
45cat << EOF > mm-c-3.ok
46#: file.c:123
47msgid "1"
48msgstr "1x"
49
50#: file.c:345
51msgid "one, two, three"
52msgstr "1, 2, 3"
53EOF
54
55: ${DIFF=diff}
56${DIFF} mm-c-3.ok mm-c-3.out
57result=$?
58
59rm -fr $tmpfiles
60
61exit $result
62