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