[evolution-patches] Patch for bug#36247



To improved the performance of the translation function _(str) for a 
particular kind of frequently occurring string.


Vardhman

-- 
Vardhman Jain
III Year B.Tech. CSE
IIIT-Hyderabad
Address:
Room No 27, NBH, IIIT-Hyderabad,Hyderabad 500019

presence on net:
    http://students.iiit.net/~vardhman

Index: gui/e-itip-control.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-itip-control.c,v
retrieving revision 1.145
diff -u -r1.145 e-itip-control.c
--- a/gui/e-itip-control.c	11 May 2004 22:05:03 -0000	1.145
+++ b/gui/e-itip-control.c	4 Jun 2004 22:15:19 -0000
@@ -679,6 +679,7 @@
 	EItipControlPrivate *priv;
 	ECalComponentDateTime datetime;
 	static char buffer[1024];
+	char proper_text_for_gettext[1024];
 	gboolean wrote = FALSE, task_completed = FALSE;
 	ECalComponentVType type;
 
@@ -687,10 +688,12 @@
 	type = e_cal_component_get_vtype (comp);
 
 	buffer[0] = '\0';
+	proper_text_for_gettext[0]='\0';
 	e_cal_component_get_dtstart (comp, &datetime);
 	if (datetime.value) {
+		sprintf(proper_text_for_gettext,"<b> %s: </b>",_("Start"));
 		write_label_piece (itip, &datetime, buffer, 1024,
-				   _("<b>Starts:</b> "),
+				  proper_text_for_gettext,
 				   "<br>", FALSE);
 		gtk_html_write (html, html_stream, buffer, strlen(buffer));
 		wrote = TRUE;
@@ -698,9 +701,11 @@
 	e_cal_component_free_datetime (&datetime);
 
 	buffer[0] = '\0';
+	proper_text_for_gettext[0]='\0';
 	e_cal_component_get_dtend (comp, &datetime);
 	if (datetime.value){
-		write_label_piece (itip, &datetime, buffer, 1024, _("<b>Ends:</b> "), "<br>", FALSE);
+		sprintf(proper_text_for_gettext,"<b> %s: </b>",_("Ends"));
+		write_label_piece (itip, &datetime, buffer, 1024, proper_text_for_gettext, "<br>", FALSE);
 		gtk_html_write (html, html_stream, buffer, strlen (buffer));
 		wrote = TRUE;
 	}
@@ -714,13 +719,16 @@
 	}
 
 	buffer[0] = '\0';
+	proper_text_for_gettext[0]='\0';
 	datetime.tzid = NULL;
 	e_cal_component_get_completed (comp, &datetime.value);
 	if (type == E_CAL_COMPONENT_TODO && datetime.value) {
 		/* Pass TRUE as is_utc, so it gets converted to the current
 		   timezone. */
+		sprintf(proper_text_for_gettext,"<b> %s: </b>",_("Completed"));
 		datetime.value->is_utc = TRUE;
-		write_label_piece (itip, &datetime, buffer, 1024, _("<b>Completed:</b> "), "<br>", FALSE);
+		//write_label_piece (itip, &datetime, buffer, 1024, _("<b>Completed:</b> "), "<br>", FALSE);
+		write_label_piece (itip, &datetime, buffer, 1024, proper_text_for_gettext, "<br>", FALSE);
 		gtk_html_write (html, html_stream, buffer, strlen (buffer));
 		wrote = TRUE;
 		task_completed = TRUE;
@@ -728,9 +736,12 @@
 	e_cal_component_free_datetime (&datetime);
 
 	buffer[0] = '\0';
+	proper_text_for_gettext[0]='\0';
 	e_cal_component_get_due (comp, &datetime);
 	if (type == E_CAL_COMPONENT_TODO && !task_completed && datetime.value) {
-		write_label_piece (itip, &datetime, buffer, 1024, _("<b>Due:</b> "), "<br>", FALSE);
+		//write_label_piece (itip, &datetime, buffer, 1024, _("<b>Due:</b> "), "<br>", FALSE);
+		sprintf(proper_text_for_gettext,"<b> %s: </b>",_("Due"));
+		write_label_piece (itip, &datetime, buffer, 1024, proper_text_for_gettext, "<br>", FALSE);
 		gtk_html_write (html, html_stream, buffer, strlen (buffer));
 		wrote = TRUE;
 	}
@@ -815,6 +826,7 @@
 	const gchar *const_html;
 	gchar *filename;
 
+	char proper_text_for_gettext[1024];
 	priv = itip->priv;
 
 	if (priv->html == NULL)
@@ -922,7 +934,10 @@
 
 	/* Summary */
 	e_cal_component_get_summary (priv->comp, &text);
-	html = text.value ? camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0) : _("<i>None</i>");
+       //html = text.value ? camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0) : _("<i>None</i>");
+	proper_text_for_gettext[0]='\0';
+	sprintf(proper_text_for_gettext,"<i> %s </i>",_("None"));
+	html = text.value ? camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0) : proper_text_for_gettext;
 	gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>",
 				_("Summary:"), html);
 	if (text.value)


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