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