• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test handling of obsolete/untranslated messages.
5
6cat <<EOF > mm-test3.in1
7#
8# def.po
9#
10#: file:100
11msgid ""
12"not existing"
13msgstr "but with translation"
14
15#: file2:101
16msgid "not existing without translation"
17msgstr ""
18
19#: file3:102
20msgid "still existing"
21msgstr "translation"
22
23#: should-not-be-here:10
24#~ msgid "former obsolete"
25#~ msgstr ""
26#~ "but again useful"
27
28#~ msgid "this stays obsolete"
29#~ msgstr "even after running msgmerge"
30
31#
32# trailing comments should be removed
33EOF
34
35cat <<EOF > mm-test3.in2
36#
37# ref.po
38#
39#: file3:102
40msgid "still existing"
41msgstr "here is normally no comment"
42
43#: file4:10
44msgid ""
45"former obsolete"
46msgstr ""
47
48#
49# trailing comments should be removed, even here
50EOF
51
52: ${MSGMERGE=msgmerge}
53${MSGMERGE} -q -o mm-test3.tmp mm-test3.in1 mm-test3.in2 || Exit 1
54LC_ALL=C tr -d '\r' < mm-test3.tmp > mm-test3.out || Exit 1
55
56cat << EOF > mm-test3.ok
57#: file3:102
58msgid "still existing"
59msgstr "translation"
60
61#: file4:10
62msgid "former obsolete"
63msgstr "but again useful"
64
65#
66# def.po
67#
68#~ msgid "not existing"
69#~ msgstr "but with translation"
70
71#~ msgid "this stays obsolete"
72#~ msgstr "even after running msgmerge"
73EOF
74
75: ${DIFF=diff}
76${DIFF} mm-test3.ok mm-test3.out
77result=$?
78
79exit $result
80