2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test of GtkBuilder support.
5 # Checks the extraction of a medium size GtkBuilder file, with
6 # comments, context and translatable and not translatable content.
8 cat <<EOF > xg-gl-7-empty.glade
13 : ${XGETTEXT=xgettext}
14 ${XGETTEXT} -o xg-gl-7.pot xg-gl-7-empty.glade 2>/dev/null
16 echo "Skipping test: xgettext was built without Glade support"
20 cat <<EOF > xg-gl-7.ui
21 <?xml version="1.0" encoding="UTF-8"?>
23 <!-- interface-requires gtk+ 3.0 -->
24 <object class="GtkImage" id="image1">
25 <property name="visible">True</property>
26 <property name="can_focus">False</property>
27 <property name="stock">gtk-about</property>
29 <object class="GtkImage" id="image2">
30 <property name="visible">True</property>
31 <property name="can_focus">False</property>
32 <property name="stock">gtk-help</property>
34 <object class="GtkImage" id="image3">
35 <property name="visible">True</property>
36 <property name="can_focus">False</property>
37 <property name="stock">gtk-connect</property>
39 <object class="GtkListStore" id="liststore">
41 <!-- column-name first column -->
42 <column type="gchararray"/>
43 <!-- column-name second column -->
44 <column type="gchararray"/>
45 <!-- column-name not extracted column -->
46 <column type="guint64"/>
50 <col id="0" translatable="yes" context="First row">Hi</col>
51 <col id="1" translatable="yes" comments="A comment.">Comment</col>
55 <col id="0" translatable="yes" context="First row">Hello</col>
56 <col id="1" translatable="yes" comments="This is no translatable.">Translatable comment.</col>
60 <col id="0" translatable="no" context="First row" comments="Yeah">Oi</col>
61 <col id="1" translatable="yes" context="This is not translatable">Please...</col>
62 <col id="2">86855555</col>
65 <col id="0" translatable="yes" context="First row">Hi</col>
66 <col id="1" translatable="yes" comments="A multiline comment.">Comment</col>
71 <object class="GtkWindow" id="window">
72 <property name="can_focus">False</property>
74 <object class="GtkBox" id="box">
75 <property name="visible">True</property>
76 <property name="can_focus">False</property>
77 <property name="orientation">vertical</property>
79 <object class="GtkMenuBar" id="menubar">
80 <property name="visible">True</property>
81 <property name="can_focus">False</property>
83 <object class="GtkMenuItem" id="menuitem1">
84 <property name="use_action_appearance">False</property>
85 <property name="visible">True</property>
86 <property name="can_focus">False</property>
87 <property name="label" translatable="yes" context="Menu" comments="This thing is the menu label">One thing</property>
88 <property name="use_underline">True</property>
89 <child type="submenu">
90 <object class="GtkMenu" id="menu1">
91 <property name="visible">True</property>
92 <property name="can_focus">False</property>
94 <object class="GtkImageMenuItem" id="imagemenuitem1">
95 <property name="label" translatable="yes" context="One thing" comments="This thing is the label in the inner menu.">One thing</property>
96 <property name="use_action_appearance">False</property>
97 <property name="visible">True</property>
98 <property name="can_focus">False</property>
99 <property name="image">image1</property>
100 <property name="use_stock">False</property>
108 <object class="GtkMenuItem" id="menuitem2">
109 <property name="use_action_appearance">False</property>
110 <property name="visible">True</property>
111 <property name="can_focus">False</property>
112 <property name="label" translatable="yes" context="Menu" comments="This is easy.">H_elp</property>
113 <property name="use_underline">True</property>
114 <child type="submenu">
115 <object class="GtkMenu" id="menu2">
116 <property name="visible">True</property>
117 <property name="can_focus">False</property>
119 <object class="GtkImageMenuItem" id="imagemenuitem2">
120 <property name="label" translatable="yes" context="Second menu" comments="This one thing is for the second menu.">One thing</property>
121 <property name="use_action_appearance">False</property>
122 <property name="visible">True</property>
123 <property name="can_focus">False</property>
124 <property name="image">image2</property>
125 <property name="use_stock">False</property>
129 <object class="GtkImageMenuItem" id="imagemenuitem3">
130 <property name="label" translatable="yes" context="Second menu" comments="To you too.">Greetings</property>
131 <property name="use_action_appearance">False</property>
132 <property name="visible">True</property>
133 <property name="can_focus">False</property>
134 <property name="image">image3</property>
135 <property name="use_stock">False</property>
144 <property name="expand">False</property>
145 <property name="fill">True</property>
146 <property name="position">0</property>
150 <object class="GtkTreeView" id="treeview2">
151 <property name="visible">True</property>
152 <property name="can_focus">True</property>
153 <property name="model">liststore</property>
154 <signal name="columns-changed" handler="myfunction_treeview_columns_changed" object="treeview-selection2" swapped="no"/>
155 <child internal-child="selection">
156 <object class="GtkTreeSelection" id="treeview-selection2"/>
160 <property name="expand">True</property>
161 <property name="fill">True</property>
162 <property name="position">1</property>
166 <object class="GtkButton" id="button">
167 <property name="label" translatable="yes" context="Button" comments="This one thing is the button.">One thing</property>
168 <property name="use_action_appearance">False</property>
169 <property name="visible">True</property>
170 <property name="can_focus">True</property>
171 <property name="receives_default">True</property>
172 <property name="use_action_appearance">False</property>
175 <property name="expand">False</property>
176 <property name="fill">True</property>
177 <property name="position">2</property>
186 : ${XGETTEXT=xgettext}
187 ${XGETTEXT} -o - xg-gl-7.ui | grep -v 'POT-Creation-Date' > xg-gl-7.pot || exit 1
189 cat <<\EOF > xg-gl-7.ok
190 # SOME DESCRIPTIVE TITLE.
191 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
192 # This file is distributed under the same license as the PACKAGE package.
193 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
198 "Project-Id-Version: PACKAGE VERSION\n"
199 "Report-Msgid-Bugs-To: \n"
200 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
201 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
202 "Language-Team: LANGUAGE <LL@li.org>\n"
204 "MIME-Version: 1.0\n"
205 "Content-Type: text/plain; charset=CHARSET\n"
206 "Content-Transfer-Encoding: 8bit\n"
208 #: xg-gl-7.ui:30 xg-gl-7.ui:45
216 #: xg-gl-7.ui:31 xg-gl-7.ui:46
225 #. This is no translatable.
227 msgid "Translatable comment."
231 msgctxt "This is not translatable"
235 #. This thing is the menu label
241 #. This thing is the label in the inner menu.
253 #. This one thing is for the second menu.
255 msgctxt "Second menu"
261 msgctxt "Second menu"
265 #. This one thing is the button.
273 ${DIFF} xg-gl-7.ok xg-gl-7.pot