Added Translated By tab

This commit is contained in:
Yevgen Muntyan 2007-02-27 22:02:06 -06:00
parent 161f0ad45a
commit f6e36a1173
2 changed files with 89 additions and 22 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!-- Generated with glade3
<!--Generated with glade3 3.0.3 on Fri Feb 23 08:44:02 2007 by muntyan@munt10
Version: 3.0.0
Date: Sun Dec 10 15:05:08 2006
User: muntyan
@ -8,7 +8,7 @@
-->
<glade-interface>
<widget class="GtkDialog" id="credits">
<property name="title">Credits</property>
<property name="title" translatable="yes" context="yes" comments="Translators: do not translate the part before |">Dialog title|Credits</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="default_width">360</property>
<property name="default_height">260</property>
@ -19,7 +19,7 @@
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<child>
<widget class="GtkNotebook" id="notebook1">
<widget class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
@ -84,6 +84,39 @@
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow5">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<child>
<widget class="GtkTextView" id="translated_by">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="cursor_visible">False</property>
</widget>
</child>
</widget>
<packing>
<property name="position">2</property>
<property name="tab_expand">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes" comments="Tab label in Credits dialog">Translated by</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="position">2</property>
<property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
@ -115,7 +148,7 @@
</child>
</widget>
<widget class="GtkDialog" id="license">
<property name="title">License</property>
<property name="title" translatable="yes" context="yes" comments="Translators: do not translate the part before |">Dialog title|License</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="default_width">420</property>
<property name="default_height">320</property>
@ -171,7 +204,7 @@
</child>
</widget>
<widget class="GtkDialog" id="system">
<property name="title">System Info</property>
<property name="title" translatable="yes" context="yes" comments="System Info dialog title, do not translate the part before the |">Dialog title|System Info</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="default_width">360</property>
<property name="default_height">260</property>
@ -212,7 +245,7 @@
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="label">gtk-close</property>
<property name="label" context="yes">gtk-close</property>
<property name="use_stock">True</property>
<property name="response_id">-6</property>
</widget>
@ -227,7 +260,7 @@
</child>
</widget>
<widget class="GtkDialog" id="dialog">
<property name="title">About</property>
<property name="title" translatable="yes" context="yes" comments="Translators: do not translate the part before |">Dialog title|About</property>
<property name="resizable">False</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="destroy_with_parent">True</property>
@ -256,7 +289,7 @@
<widget class="GtkLabel" id="name">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">&lt;span size="xx-large"&gt;&lt;b&gt;The App&lt;/b&gt;&lt;/span&gt;</property>
<property name="label" context="yes">&lt;span size="xx-large"&gt;&lt;b&gt;The App&lt;/b&gt;&lt;/span&gt;</property>
<property name="use_markup">True</property>
<property name="selectable">True</property>
</widget>
@ -270,7 +303,7 @@
<widget class="GtkLabel" id="description">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">The App is an app</property>
<property name="label" context="yes">The App is an app</property>
<property name="selectable">True</property>
</widget>
<packing>
@ -283,7 +316,7 @@
<widget class="GtkLabel" id="copyright">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">&lt;small&gt;© 2004-2006 The Author&lt;/small&gt;</property>
<property name="label" context="yes">&lt;small&gt;© 2004-2006 The Author&lt;/small&gt;</property>
<property name="use_markup">True</property>
<property name="selectable">True</property>
</widget>
@ -296,11 +329,11 @@
<child>
<widget class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="xscale">0.000000</property>
<property name="xscale">0</property>
<child>
<widget class="GtkLabel" id="url">
<property name="visible">True</property>
<property name="label">&lt;span foreground="#0000FF"&gt;http://somesite.org&lt;/span&gt;</property>
<property name="label" context="yes">&lt;span foreground="#0000FF"&gt;http://somesite.org&lt;/span&gt;</property>
<property name="use_markup">True</property>
</widget>
</child>
@ -328,8 +361,8 @@
<child>
<widget class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="xscale">0.000000</property>
<property name="yscale">0.000000</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
@ -347,7 +380,7 @@
<child>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="label" translatable="yes" comments="Credits button label in About dialog">C_redits</property>
<property name="label" translatable="yes" context="yes" comments="Credits button label in About dialog">C_redits</property>
<property name="use_underline">True</property>
</widget>
<packing>
@ -367,7 +400,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="label" translatable="yes" comments="License button label in About dialog">_License</property>
<property name="label" translatable="yes" context="yes" comments="License button label in About dialog">_License</property>
<property name="use_underline">True</property>
</widget>
<packing>
@ -379,7 +412,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="label">gtk-close</property>
<property name="label" context="yes">gtk-close</property>
<property name="use_stock">True</property>
</widget>
<packing>

View File

@ -41,6 +41,41 @@ static gpointer system_info_dialog;
#define MOO_TYPE_HTML GTK_TYPE_TEXT_VIEW
#endif
static void
set_translator_credits (MooGladeXML *xml)
{
GtkWidget *notebook, *page;
const char *credits, *credits_markup;
MooHtml *html;
/* Translators: this goes into About box, under Translated by tab */
credits = _("translator_credits");
/* Translators: this goes into About box, under Translated by tab,
this must be valid html markup, e.g.
"Some Guy <a href=\"mailto://someguy@domain.net\">&lt;someguy@domain.net&gt;</a>" */
credits_markup = _("translator_credits_markup");
if (!strcmp (credits, "translator_credits"))
{
notebook = moo_glade_xml_get_widget (xml, "notebook");
page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 2);
gtk_widget_hide (page);
return;
}
html = moo_glade_xml_get_widget (xml, "translated_by");
#if defined(MOO_USE_XML) && !defined(__WIN32__)
if (strcmp (credits_markup, "translator_credits_markup") != 0)
_moo_html_load_memory (html, credits_markup, -1, NULL, NULL);
else
#endif
{
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (html));
gtk_text_buffer_insert_at_cursor (buffer, credits, -1);
}
}
static void
show_credits (void)
{
@ -63,6 +98,7 @@ show_credits (void)
xml = moo_glade_xml_new_empty (GETTEXT_PACKAGE);
moo_glade_xml_map_id (xml, "written_by", MOO_TYPE_HTML);
moo_glade_xml_map_id (xml, "translated_by", MOO_TYPE_HTML);
moo_glade_xml_parse_memory (xml, MOO_APP_ABOUT_GLADE_UI, -1, "credits", NULL);
credits_dialog = moo_glade_xml_get_widget (xml, "credits");
@ -85,6 +121,8 @@ show_credits (void)
}
#endif
set_translator_credits (xml);
thanks = moo_glade_xml_get_widget (xml, "thanks");
buffer = gtk_text_view_get_buffer (thanks);
gtk_text_buffer_insert_at_cursor (buffer, info->credits, -1);
@ -153,7 +191,7 @@ create_about_dialog (void)
MooGladeXML *xml;
GtkWidget *dialog, *logo, *button;
const MooAppInfo *info;
char *markup, *title;
char *markup;
GtkLabel *label;
MooLinkLabel *url;
@ -166,9 +204,6 @@ create_about_dialog (void)
dialog = moo_glade_xml_get_widget (xml, "dialog");
g_signal_connect (dialog, "key-press-event", G_CALLBACK (about_dialog_key_press), NULL);
title = g_strdup_printf ("About %s", info->full_name);
gtk_window_set_title (GTK_WINDOW (dialog), title);
g_object_add_weak_pointer (G_OBJECT (dialog), &about_dialog);
g_signal_connect (dialog, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), NULL);
@ -215,7 +250,6 @@ create_about_dialog (void)
button = moo_glade_xml_get_widget (xml, "close_button");
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_hide), dialog);
g_free (title);
g_object_unref (xml);
return dialog;