3 # Test of Glade support, in particular ISO-8859-1 to UTF-8 conversion
4 # and ASCII entities (< > ").
7 trap 'rm -fr $tmpfiles' 1 2 3 15
9 tmpfiles="$tmpfiles empty.glade"
10 cat <<EOF > empty.glade
15 tmpfiles="$tmpfiles xg-gl-2.pot"
16 : ${XGETTEXT=xgettext}
17 ${XGETTEXT} -o xg-gl-2.pot empty.glade 2>/dev/null
19 echo "Skipping test: xgettext was built without Glade support"
20 rm -fr $tmpfiles; exit 77
23 tmpfiles="$tmpfiles simple.glade"
24 cat <<\EOF > simple.glade
25 <?xml version="1.0" encoding="ISO-8859-1"?>
30 <class>GtkWindow</class>
31 <name>HelloWindow</name>
32 <border_width>5</border_width>
35 <handler>gtk_main_quit</handler>
38 <type>GTK_WINDOW_TOPLEVEL</type>
39 <position>GTK_WIN_POS_NONE</position>
40 <allow_shrink>True</allow_shrink>
41 <allow_grow>True</allow_grow>
42 <auto_shrink>False</auto_shrink>
45 <class>GtkButton</class>
46 <name>Hello World</name>
47 <can_focus>True</can_focus>
50 <handler>gtk_widget_destroy</handler>
51 <object>HelloWindow</object>
53 <!-- Der übliche Programm-Gruß -->
54 <label>Hello World</label>
55 <comments>This <button> displays "Hello World".</comments>
62 tmpfiles="$tmpfiles xg-gl-2.tmp xg-gl-2.pot"
63 : ${XGETTEXT=xgettext}
64 ${XGETTEXT} --add-comments -o xg-gl-2.tmp simple.glade
65 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
66 # Don't simplify this to "grep ... < xg-gl-2.tmp", otherwise OpenBSD 4.0 grep
67 # only outputs "Binary file (standard input) matches".
68 cat xg-gl-2.tmp | grep -v 'POT-Creation-Date' > xg-gl-2.pot
70 tmpfiles="$tmpfiles xg-gl-2.ok"
71 cat <<\EOF > xg-gl-2.ok
72 # SOME DESCRIPTIVE TITLE.
73 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
74 # This file is distributed under the same license as the PACKAGE package.
75 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
80 "Project-Id-Version: PACKAGE VERSION\n"
81 "Report-Msgid-Bugs-To: \n"
82 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
83 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
84 "Language-Team: LANGUAGE <LL@li.org>\n"
87 "Content-Type: text/plain; charset=UTF-8\n"
88 "Content-Transfer-Encoding: 8bit\n"
94 #. Der übliche Programm-Gruß
100 msgid "This <button> displays \"Hello World\"."
105 ${DIFF} xg-gl-2.ok xg-gl-2.pot