[evolution-patches] [GtkHTML]Fix i18n problem in gtkhtml-editor component.



Hi, guys,

In gtkhtml-editor component, all the tooltips in toolbar are not
localized. Because gnome_app_fill_toolbar_with_data() function and
struct GnomeUIInfo have no domain information. libgnomeui will gettext
from the main-process's domain (evolution) or libgnomeui's domain, but
not the domain of gtkhtml.

Please review this patch. This patch should be applied in 1.4 and trunk.

Regards,

-- 
Yong Sun <Yong Sun sun com>
Sun (China) ERI
Index: toolbar.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/toolbar.c,v
retrieving revision 1.61
diff -u -p -r1.61 toolbar.c
--- toolbar.c	12 May 2003 20:46:48 -0000	1.61
+++ toolbar.c	10 Feb 2004 11:05:00 -0000
@@ -568,6 +568,9 @@ static GtkWidget *
 create_style_toolbar (GtkHTMLControlData *cd)
 {
 	GtkWidget *hbox;
+	
+	GnomeUIInfo *uiinfo;
+	GtkTooltips *tooltips = gtk_tooltips_new();
 
 	hbox = gtk_hbox_new (FALSE, 0);
 
@@ -584,6 +587,26 @@ create_style_toolbar (GtkHTMLControlData
 				    NULL, NULL);
 
 	gnome_app_fill_toolbar_with_data (GTK_TOOLBAR (cd->toolbar_style), editor_toolbar_style_uiinfo, NULL, cd);
+
+	for (uiinfo = editor_toolbar_style_uiinfo; uiinfo->type != GNOME_APP_UI_ENDOFINFO; uiinfo++) {
+		GnomeUIInfo *tmp;
+		switch (uiinfo->type) {
+		case GNOME_APP_UI_TOGGLEITEM:
+		case GNOME_APP_UI_ITEM:
+			gtk_tooltips_set_tip(tooltips, uiinfo->widget, _(uiinfo->hint), NULL);
+			break;
+		case GNOME_APP_UI_RADIOITEMS:
+			for (tmp = uiinfo->moreinfo; tmp->type != GNOME_APP_UI_ENDOFINFO; tmp++) {
+				gtk_tooltips_set_tip(tooltips, tmp->widget, _(tmp->hint), NULL);
+			}
+				
+			break;
+		default:
+			break;
+		}
+	}
+
+
 	gtk_toolbar_append_widget (GTK_TOOLBAR (cd->toolbar_style),
 				   setup_color_combo (cd),
 				   NULL, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]