Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-glade-3
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test of Glade 2 support.
5
6 cat <<EOF > xg-gl-3-empty.glade
7 <?xml version="1.0"?>
8 <GTK-Interface/>
9 EOF
10
11 : ${XGETTEXT=xgettext}
12 ${XGETTEXT} -o xg-gl-3.pot xg-gl-3-empty.glade 2>/dev/null
13 test $? = 0 || {
14   echo "Skipping test: xgettext was built without Glade support"
15   exit 77
16 }
17
18 cat <<EOF > xg-gl-3-asciitable.glade2
19 <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
20 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd" >
21
22 <glade-interface>
23   <widget class="GtkDialog" id="dialog">
24     <property name="visible">no</property>
25     <property name="title" translatable="yes">gedit: ASCII table</property>
26     <property name="type">GTK_WINDOW_TOPLEVEL</property>
27     <property name="modal">no</property>
28     <property name="allow_shrink">yes</property>
29     <property name="allow_grow">yes</property>
30     <property name="window-position">GTK_WIN_POS_NONE</property>
31
32     <child internal-child="vbox">
33       <widget class="GtkVBox" id="dialog-vbox1">
34         <property name="homogeneous">no</property>
35         <property name="spacing">8</property>
36         <property name="visible">yes</property>
37
38         <child internal-child="action_area">
39           <widget class="GtkHButtonBox" id="dialog-action_area1">
40             <property name="layout_style">GTK_BUTTONBOX_END</property>
41             <property name="spacing">8</property>
42             <property name="visible">yes</property>
43
44             <child>
45               <widget class="GtkButton" id="insert_char_button">
46                 <property name="can_default">yes</property>
47                 <property name="can_focus">yes</property>
48                 <property name="label" translatable="yes">Insert char</property>
49                 <property name="visible">yes</property>
50               </widget>
51             </child>
52
53             <child>
54               <widget class="GtkButton" id="close_button">
55                 <property name="can_default">yes</property>
56                 <property name="can_focus">yes</property>
57                 <property name="visible">yes</property>
58                 <property name="label">gtk-close</property>
59                 <property name="use_stock">yes</property>
60                 <property name="use_underline">yes</property>
61               </widget>
62             </child>
63
64             <child>
65               <widget class="GtkButton" id="help_button">
66                 <property name="can_default">yes</property>
67                 <property name="can_focus">yes</property>
68                 <property name="visible">yes</property>
69                 <property name="label">gtk-help</property>
70                 <property name="use_stock">yes</property>
71                 <property name="use_underline">yes</property>
72               </widget>
73             </child>
74           </widget>
75           <packing>
76             <property name="padding">0</property>
77             <property name="expand">no</property>
78             <property name="fill">yes</property>
79             <property name="pack_type">GTK_PACK_END</property>
80           </packing>
81         </child>
82
83         <child>
84           <widget class="GtkVBox" id="asciitable_dialog_content">
85             <property name="border_width">6</property>
86             <property name="homogeneous">no</property>
87             <property name="spacing">8</property>
88             <property name="visible">yes</property>
89
90             <child>
91               <widget class="GtkLabel" id="label1">
92                 <property name="label" translatable="yes">If you wish to insert any of the characters in to the active 
93 document, select the character and click the &quot;Insert Char&quot; 
94 button or double click the character in the table.</property>
95                 <property name="justify">GTK_JUSTIFY_LEFT</property>
96                 <property name="wrap">no</property>
97                 <property name="xalign">0.0</property>
98                 <property name="yalign">0.5</property>
99                 <property name="xpad">0</property>
100                 <property name="ypad">0</property>
101                 <property name="visible">yes</property>
102               </widget>
103               <packing>
104                 <property name="padding">0</property>
105                 <property name="expand">no</property>
106                 <property name="fill">no</property>
107               </packing>
108             </child>
109
110             <child>
111               <widget class="GtkScrolledWindow" id="scrolledwindow1">
112                 <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
113                 <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
114                 <property name="shadow_type">GTK_SHADOW_IN</property>
115                 <property name="height-request">350</property>
116                 <property name="visible">yes</property>
117
118                 <child>
119                   <widget class="GtkTreeView" id="ascii_table">
120                     <property name="can_focus">yes</property>
121                     <property name="headers-visible">yes</property>
122                     <property name="visible">yes</property>
123                   </widget>
124                 </child>
125
126                 <child internal-child="hscrollbar">
127                   <widget class="GtkHScrollbar" id="convertwidget1">
128                     <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
129                     <property name="visible">yes</property>
130                   </widget>
131                 </child>
132
133                 <child internal-child="vscrollbar">
134                   <widget class="GtkVScrollbar" id="convertwidget2">
135                     <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
136                     <property name="visible">yes</property>
137                   </widget>
138                 </child>
139               </widget>
140               <packing>
141                 <property name="padding">0</property>
142                 <property name="expand">yes</property>
143                 <property name="fill">yes</property>
144               </packing>
145             </child>
146           </widget>
147           <packing>
148             <property name="padding">0</property>
149             <property name="expand">yes</property>
150             <property name="fill">yes</property>
151           </packing>
152         </child>
153       </widget>
154       <packing>
155         <property name="padding">4</property>
156         <property name="expand">yes</property>
157         <property name="fill">yes</property>
158       </packing>
159     </child>
160   </widget>
161 </glade-interface>
162 EOF
163
164 : ${XGETTEXT=xgettext}
165 ${XGETTEXT} -o xg-gl-3.tmp xg-gl-3-asciitable.glade2  || exit 1
166 # Don't simplify this to "grep ... < xg-gl-3.tmp", otherwise OpenBSD 4.0 grep
167 # only outputs "Binary file (standard input) matches".
168 cat xg-gl-3.tmp | grep -v 'POT-Creation-Date' > xg-gl-3.pot
169
170 cat <<\EOF > xg-gl-3.ok
171 # SOME DESCRIPTIVE TITLE.
172 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
173 # This file is distributed under the same license as the PACKAGE package.
174 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
175 #
176 #, fuzzy
177 msgid ""
178 msgstr ""
179 "Project-Id-Version: PACKAGE VERSION\n"
180 "Report-Msgid-Bugs-To: \n"
181 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
182 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
183 "Language-Team: LANGUAGE <LL@li.org>\n"
184 "Language: \n"
185 "MIME-Version: 1.0\n"
186 "Content-Type: text/plain; charset=CHARSET\n"
187 "Content-Transfer-Encoding: 8bit\n"
188
189 #: xg-gl-3-asciitable.glade2:7
190 msgid "gedit: ASCII table"
191 msgstr ""
192
193 #: xg-gl-3-asciitable.glade2:30
194 msgid "Insert char"
195 msgstr ""
196
197 #: xg-gl-3-asciitable.glade2:74
198 msgid ""
199 "If you wish to insert any of the characters in to the active \n"
200 "document, select the character and click the \"Insert Char\" \n"
201 "button or double click the character in the table."
202 msgstr ""
203 EOF
204
205 : ${DIFF=diff}
206 ${DIFF} xg-gl-3.ok xg-gl-3.pot
207 result=$?
208
209 exit $result