/* xgettext glade backend.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
This file was written by Bruno Haible <haible@clisp.cons.org>, 2002.
stack[stack_depth - 1].extract_string = false;
p = &stack[stack_depth];
+ /* In Glade 1, a few specific elements are translatable. */
p->extract_string =
(find_entry (&keywords, name, strlen (name), &hash_result) == 0);
+ /* In Glade 2, all <property> and <atkproperty> elements are translatable
+ that have the attribute translatable="yes". */
+ if (!p->extract_string
+ && (strcmp (name, "property") == 0 || strcmp (name, "atkproperty") == 0))
+ {
+ bool has_translatable = false;
+ const char **attp = attributes;
+ while (*attp != NULL)
+ {
+ if (strcmp (attp[0], "translatable") == 0)
+ {
+ has_translatable = (strcmp (attp[1], "yes") == 0);
+ break;
+ }
+ attp += 2;
+ }
+ p->extract_string = has_translatable;
+ }
+ if (!p->extract_string
+ && strcmp (name, "atkaction") == 0)
+ {
+ const char **attp = attributes;
+ while (*attp != NULL)
+ {
+ if (strcmp (attp[0], "description") == 0)
+ {
+ if (strcmp (attp[1], "") != 0)
+ {
+ lex_pos_ty pos;
+
+ pos.file_name = logical_file_name;
+ pos.line_number = XML_GetCurrentLineNumber (parser);
+
+ remember_a_message (mlp, xstrdup (attp[1]), &pos);
+ }
+ break;
+ }
+ attp += 2;
+ }
+ }
p->lineno = XML_GetCurrentLineNumber (parser);
p->buffer = NULL;
p->bufmax = 0;
--- /dev/null
+#!/bin/sh
+
+# Test of Glade 2 support.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles asciitable.glade2"
+cat <<EOF > asciitable.glade2
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd" >
+
+<glade-interface>
+ <widget class="GtkDialog" id="dialog">
+ <property name="visible">no</property>
+ <property name="title" translatable="yes">gedit: ASCII table</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="modal">no</property>
+ <property name="allow_shrink">yes</property>
+ <property name="allow_grow">yes</property>
+ <property name="window-position">GTK_WIN_POS_NONE</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="homogeneous">no</property>
+ <property name="spacing">8</property>
+ <property name="visible">yes</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="spacing">8</property>
+ <property name="visible">yes</property>
+
+ <child>
+ <widget class="GtkButton" id="insert_char_button">
+ <property name="can_default">yes</property>
+ <property name="can_focus">yes</property>
+ <property name="label" translatable="yes">Insert char</property>
+ <property name="visible">yes</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="close_button">
+ <property name="can_default">yes</property>
+ <property name="can_focus">yes</property>
+ <property name="visible">yes</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">yes</property>
+ <property name="use_underline">yes</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="help_button">
+ <property name="can_default">yes</property>
+ <property name="can_focus">yes</property>
+ <property name="visible">yes</property>
+ <property name="label">gtk-help</property>
+ <property name="use_stock">yes</property>
+ <property name="use_underline">yes</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">no</property>
+ <property name="fill">yes</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="asciitable_dialog_content">
+ <property name="border_width">6</property>
+ <property name="homogeneous">no</property>
+ <property name="spacing">8</property>
+ <property name="visible">yes</property>
+
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="label" translatable="yes">If you wish to insert any of the characters in to the active
+document, select the character and click the "Insert Char"
+button or double click the character in the table.</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">no</property>
+ <property name="xalign">0.0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="visible">yes</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">no</property>
+ <property name="fill">no</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="height-request">350</property>
+ <property name="visible">yes</property>
+
+ <child>
+ <widget class="GtkTreeView" id="ascii_table">
+ <property name="can_focus">yes</property>
+ <property name="headers-visible">yes</property>
+ <property name="visible">yes</property>
+ </widget>
+ </child>
+
+ <child internal-child="hscrollbar">
+ <widget class="GtkHScrollbar" id="convertwidget1">
+ <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
+ <property name="visible">yes</property>
+ </widget>
+ </child>
+
+ <child internal-child="vscrollbar">
+ <widget class="GtkVScrollbar" id="convertwidget2">
+ <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
+ <property name="visible">yes</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">yes</property>
+ <property name="fill">yes</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">yes</property>
+ <property name="fill">yes</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">4</property>
+ <property name="expand">yes</property>
+ <property name="fill">yes</property>
+ </packing>
+ </child>
+ </widget>
+</glade-interface>
+EOF
+
+tmpfiles="$tmpfiles xg-test25.tmp xg-test25.pot"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} -o xg-test25.tmp asciitable.glade2
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+grep -v 'POT-Creation-Date' < xg-test25.tmp > xg-test25.pot
+
+tmpfiles="$tmpfiles xg-test25.ok"
+cat <<EOF > xg-test25.ok
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: asciitable.glade2:7
+msgid "gedit: ASCII table"
+msgstr ""
+
+#: asciitable.glade2:30
+msgid "Insert char"
+msgstr ""
+
+#: asciitable.glade2:74
+msgid ""
+"If you wish to insert any of the characters in to the active \n"
+"document, select the character and click the \"Insert Char\" \n"
+"button or double click the character in the table."
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-test25.ok xg-test25.pot
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result