• 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 msgcomm on PO files with contexts.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles mcomm-test25.in1 mcomm-test25.in2"
9cat <<\EOF > mcomm-test25.in1
10msgid ""
11msgstr ""
12"Content-Type: text/plain; charset=UTF-8\n"
13"Content-Transfer-Encoding: 8bit\n"
14
15#. A menu item
16msgctxt "File|"
17msgid "Open"
18msgstr "Ouvrir"
19
20#. A menu item
21msgctxt "File|"
22msgid "New"
23msgstr "Nouveau"
24
25#. Denote a lock's state
26msgctxt "Lock state"
27msgid "Open"
28msgstr "Ouverte"
29
30#. Denote a lock's state
31msgctxt "Lock state"
32msgid "Closed"
33msgstr "Ferm��e"
34
35#. A menu item
36#~ msgctxt "File|"
37#~ msgid "Save As"
38#~ msgstr "Enregistrer sous"
39EOF
40
41cat <<\EOF > mcomm-test25.in2
42msgid ""
43msgstr ""
44"Content-Type: text/plain; charset=UTF-8\n"
45"Content-Transfer-Encoding: 8bit\n"
46
47#. Denote a lock's state
48msgctxt "Lock state"
49msgid "Open"
50msgstr "Ouvert"
51
52#. Denote a lock's state
53msgctxt "Lock state"
54msgid "Closed"
55msgstr "Ferm��"
56
57#. A product
58msgctxt "Audi"
59msgid "car"
60msgstr "voiture"
61
62#. A product
63msgctxt "Oc��"
64msgid "copier"
65msgstr "photocopieur"
66
67#~ msgid "Save As"
68#~ msgstr "Enregistrer l'as"
69EOF
70
71tmpfiles="$tmpfiles mcomm-test25.tmp mcomm-test25.out"
72: ${MSGCOMM=msgcomm}
73${MSGCOMM} --more-than=0 -o mcomm-test25.tmp mcomm-test25.in1 mcomm-test25.in2
74test $? = 0 || { rm -fr $tmpfiles; exit 1; }
75tr -d '\r' < mcomm-test25.tmp > mcomm-test25.out
76test $? = 0 || { rm -fr $tmpfiles; exit 1; }
77
78tmpfiles="$tmpfiles mcomm-test25.ok"
79cat <<\EOF > mcomm-test25.ok
80msgid ""
81msgstr ""
82"Content-Type: text/plain; charset=UTF-8\n"
83"Content-Transfer-Encoding: 8bit\n"
84
85#. A menu item
86msgctxt "File|"
87msgid "Open"
88msgstr "Ouvrir"
89
90#. A menu item
91msgctxt "File|"
92msgid "New"
93msgstr "Nouveau"
94
95#. Denote a lock's state
96msgctxt "Lock state"
97msgid "Open"
98msgstr "Ouverte"
99
100#. Denote a lock's state
101msgctxt "Lock state"
102msgid "Closed"
103msgstr "Ferm��e"
104
105#. A product
106msgctxt "Audi"
107msgid "car"
108msgstr "voiture"
109
110#. A product
111msgctxt "Oc��"
112msgid "copier"
113msgstr "photocopieur"
114
115#. A menu item
116#~ msgctxt "File|"
117#~ msgid "Save As"
118#~ msgstr "Enregistrer sous"
119
120#~ msgid "Save As"
121#~ msgstr "Enregistrer l'as"
122EOF
123
124: ${DIFF=diff}
125${DIFF} mcomm-test25.ok mcomm-test25.out
126result=$?
127
128rm -fr $tmpfiles
129
130exit $result
131