Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-glade-4
1 #!/bin/sh
2
3 # Test of Glade 2 support.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles empty.glade"
9 cat <<EOF > empty.glade
10 <?xml version="1.0"?>
11 <GTK-Interface/>
12 EOF
13
14 tmpfiles="$tmpfiles xg-gl-4.pot"
15 : ${XGETTEXT=xgettext}
16 ${XGETTEXT} -o xg-gl-4.pot empty.glade 2>/dev/null
17 test $? = 0 || {
18   echo "Skipping test: xgettext was built without Glade support"
19   rm -fr $tmpfiles; exit 77
20 }
21
22 tmpfiles="$tmpfiles xg-gl-4.glade"
23 cat <<EOF > xg-gl-4.glade
24 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
25 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
26 <!--Generated with glade3 3.4.3 on Sat May 16 19:53:48 2009 -->
27 <glade-interface>
28   <widget class="GtkWindow" id="mainWindow">
29     <child>
30       <widget class="GtkButton" id="FormButton">
31         <property name="visible">True</property>
32         <property name="can_focus">True</property>
33         <property name="receives_default">True</property>
34         <property name="label" translatable="yes" comments="Form means shape here">Form</property>
35         <property name="response_id">0</property>
36       </widget>
37     </child>
38   </widget>
39 </glade-interface>
40 EOF
41
42 tmpfiles="$tmpfiles xg-gl-4.tmp xg-gl-4.pot"
43 : ${XGETTEXT=xgettext}
44 ${XGETTEXT} -o xg-gl-4.tmp xg-gl-4.glade
45 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
46 # Don't simplify this to "grep ... < xg-gl-4.tmp", otherwise OpenBSD 4.0 grep
47 # only outputs "Binary file (standard input) matches".
48 cat xg-gl-4.tmp | grep -v 'POT-Creation-Date' > xg-gl-4.pot
49
50 tmpfiles="$tmpfiles xg-gl-4.ok"
51 cat <<\EOF > xg-gl-4.ok
52 # SOME DESCRIPTIVE TITLE.
53 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
54 # This file is distributed under the same license as the PACKAGE package.
55 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
56 #
57 #, fuzzy
58 msgid ""
59 msgstr ""
60 "Project-Id-Version: PACKAGE VERSION\n"
61 "Report-Msgid-Bugs-To: \n"
62 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
63 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
64 "Language-Team: LANGUAGE <LL@li.org>\n"
65 "Language: \n"
66 "MIME-Version: 1.0\n"
67 "Content-Type: text/plain; charset=CHARSET\n"
68 "Content-Transfer-Encoding: 8bit\n"
69
70 #. Form means shape here
71 #: xg-gl-4.glade:11
72 msgid "Form"
73 msgstr ""
74 EOF
75
76 : ${DIFF=diff}
77 ${DIFF} xg-gl-4.ok xg-gl-4.pot
78 result=$?
79
80 rm -fr $tmpfiles
81
82 exit $result