2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test of Glade 2 support for msgctxt.
6 cat <<EOF > xg-gl-5-empty.glade
11 : ${XGETTEXT=xgettext}
12 ${XGETTEXT} -o xg-gl-5.pot xg-gl-5-empty.glade 2>/dev/null
14 echo "Skipping test: xgettext was built without Glade support"
18 cat <<EOF > xg-gl-5.glade
21 <!-- interface-requires gtk+ 2.8 -->
22 <!-- interface-naming-policy project-wide -->
23 <widget class="GtkWindow" id="window1">
25 <widget class="GtkVBox" id="vbox">
26 <property name="visible">True</property>
27 <property name="orientation">vertical</property>
29 <widget class="GtkButton" id="with_context">
30 <property name="label" translatable="yes" context="yes">Shape|Form</property>
31 <property name="visible">True</property>
32 <property name="can_focus">True</property>
33 <property name="receives_default">True</property>
36 <property name="position">0</property>
40 <widget class="GtkButton" id="without_context">
41 <property name="label" translatable="yes">Shape|Form</property>
42 <property name="visible">True</property>
43 <property name="can_focus">True</property>
44 <property name="receives_default">True</property>
47 <property name="position">1</property>
56 : ${XGETTEXT=xgettext}
57 ${XGETTEXT} -o xg-gl-5.tmp xg-gl-5.glade || exit 1
58 # Don't simplify this to "grep ... < xg-gl-5.tmp", otherwise OpenBSD 4.0 grep
59 # only outputs "Binary file (standard input) matches".
60 cat xg-gl-5.tmp | grep -v 'POT-Creation-Date' > xg-gl-5.pot
62 cat <<\EOF > xg-gl-5.ok
63 # SOME DESCRIPTIVE TITLE.
64 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
65 # This file is distributed under the same license as the PACKAGE package.
66 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
71 "Project-Id-Version: PACKAGE VERSION\n"
72 "Report-Msgid-Bugs-To: \n"
73 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
74 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
75 "Language-Team: LANGUAGE <LL@li.org>\n"
78 "Content-Type: text/plain; charset=CHARSET\n"
79 "Content-Transfer-Encoding: 8bit\n"
92 ${DIFF} xg-gl-5.ok xg-gl-5.pot
99 # Check with --extract-all option
101 ${XGETTEXT} -a -o xg-gl-5.tmp xg-gl-5.glade || exit 1
102 # Don't simplify this to "grep ... < xg-gl-5.tmp", otherwise OpenBSD 4.0 grep
103 # only outputs "Binary file (standard input) matches".
104 cat xg-gl-5.tmp | grep -v 'POT-Creation-Date' > xg-gl-5.pot
106 ${DIFF} xg-gl-5.ok xg-gl-5.pot
109 test $result = 0 || {
113 cat <<EOF > xg-gl-5b.glade
114 <?xml version="1.0"?>
116 <!-- interface-requires gtk+ 2.8 -->
117 <!-- interface-naming-policy project-wide -->
118 <widget class="GtkWindow" id="window1">
120 <widget class="GtkVBox" id="vbox">
121 <property name="visible">True</property>
122 <property name="orientation">vertical</property>
124 <widget class="GtkButton" id="with_context">
125 <property name="label" translatable="yes" context="yes">ShapeForm</property>
126 <property name="visible">True</property>
127 <property name="can_focus">True</property>
128 <property name="receives_default">True</property>
131 <property name="position">0</property>
135 <widget class="GtkButton" id="without_context">
136 <property name="label" translatable="yes">Shape|Form</property>
137 <property name="visible">True</property>
138 <property name="can_focus">True</property>
139 <property name="receives_default">True</property>
142 <property name="position">1</property>
151 : ${XGETTEXT=xgettext}
152 ${XGETTEXT} -o xg-gl-5b.tmp xg-gl-5b.glade 2>/dev/null || exit 1
153 # Don't simplify this to "grep ... < xg-gl-5b.tmp", otherwise OpenBSD 4.0 grep
154 # only outputs "Binary file (standard input) matches".
155 cat xg-gl-5b.tmp | grep -v 'POT-Creation-Date' > xg-gl-5b.pot
157 cat <<\EOF > xg-gl-5b.ok
158 # SOME DESCRIPTIVE TITLE.
159 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
160 # This file is distributed under the same license as the PACKAGE package.
161 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
166 "Project-Id-Version: PACKAGE VERSION\n"
167 "Report-Msgid-Bugs-To: \n"
168 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
169 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
170 "Language-Team: LANGUAGE <LL@li.org>\n"
172 "MIME-Version: 1.0\n"
173 "Content-Type: text/plain; charset=CHARSET\n"
174 "Content-Transfer-Encoding: 8bit\n"
182 ${DIFF} xg-gl-5b.ok xg-gl-5b.pot