No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / xgettext-glade-2
blobc40ead83945f2ba3808e91f2f9f2a17e488301f3
1 #!/bin/sh
3 # Test of Glade support, in particular ISO-8859-1 to UTF-8 conversion
4 # and ASCII entities (< > ").
6 tmpfiles=""
7 trap 'rm -fr $tmpfiles' 1 2 3 15
9 tmpfiles="$tmpfiles empty.glade"
10 cat <<EOF > empty.glade
11 <?xml version="1.0"?>
12 <GTK-Interface/>
13 EOF
15 tmpfiles="$tmpfiles xg-gl-2.pot"
16 : ${XGETTEXT=xgettext}
17 ${XGETTEXT} -o xg-gl-2.pot empty.glade 2>/dev/null
18 test $? = 0 || { rm -fr $tmpfiles; exit 77; }
20 tmpfiles="$tmpfiles simple.glade"
21 cat <<\EOF > simple.glade
22 <?xml version="1.0" encoding="ISO-8859-1"?>
23 <GTK-Interface>
26 <widget>
27 <class>GtkWindow</class>
28 <name>HelloWindow</name>
29 <border_width>5</border_width>
30 <Signal>
31 <name>destroy</name>
32 <handler>gtk_main_quit</handler>
33 </Signal>
34 <title>Hello</title>
35 <type>GTK_WINDOW_TOPLEVEL</type>
36 <position>GTK_WIN_POS_NONE</position>
37 <allow_shrink>True</allow_shrink>
38 <allow_grow>True</allow_grow>
39 <auto_shrink>False</auto_shrink>
41 <widget>
42 <class>GtkButton</class>
43 <name>Hello World</name>
44 <can_focus>True</can_focus>
45 <Signal>
46 <name>clicked</name>
47 <handler>gtk_widget_destroy</handler>
48 <object>HelloWindow</object>
49 </Signal>
50 <!-- Der übliche Programm-Gruß -->
51 <label>Hello World</label>
52 <comments>This &lt;button&gt; displays &quot;Hello World&quot;.</comments>
53 </widget>
54 </widget>
56 </GTK-Interface>
57 EOF
59 tmpfiles="$tmpfiles xg-gl-2.tmp xg-gl-2.pot"
60 : ${XGETTEXT=xgettext}
61 ${XGETTEXT} --add-comments -o xg-gl-2.tmp simple.glade
62 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
63 grep -v 'POT-Creation-Date' < xg-gl-2.tmp > xg-gl-2.pot
65 tmpfiles="$tmpfiles xg-gl-2.ok"
66 cat <<\EOF > xg-gl-2.ok
67 # SOME DESCRIPTIVE TITLE.
68 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
69 # This file is distributed under the same license as the PACKAGE package.
70 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
72 #, fuzzy
73 msgid ""
74 msgstr ""
75 "Project-Id-Version: PACKAGE VERSION\n"
76 "Report-Msgid-Bugs-To: \n"
77 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
78 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
79 "Language-Team: LANGUAGE <LL@li.org>\n"
80 "MIME-Version: 1.0\n"
81 "Content-Type: text/plain; charset=UTF-8\n"
82 "Content-Transfer-Encoding: 8bit\n"
84 #: simple.glade:13
85 msgid "Hello"
86 msgstr ""
88 #. Der übliche Programm-Gruß
89 #: simple.glade:30
90 msgid "Hello World"
91 msgstr ""
93 #: simple.glade:31
94 msgid "This <button> displays \"Hello World\"."
95 msgstr ""
96 EOF
98 : ${DIFF=diff}
99 ${DIFF} xg-gl-2.ok xg-gl-2.pot
100 result=$?
102 rm -fr $tmpfiles
104 exit $result