Re: [evolution-patches] Patch for translation-issues in save-calendar plugin (#73099)



Hi there gnome-i18n team,

This patch fixes translation issues #73099 and #73098 but need approval

You'll need to use -R for this patch

freax lort:~/cvs/gnome/evolution/plugins/save-calendar $ cvs diff -u -D "20 minutes ago" > /home/freax/Documents/Programming/Patches/stringpatch.diff
cvs server: Diffing .
freax lort:~/cvs/gnome/evolution/plugins/save-calendar $


On Wed, 2005-03-02 at 19:22 +0100, Rodrigo Moya wrote:
On Wed, 2005-03-02 at 13:14 -0500, JP Rosevear wrote:
> On Wed, 2005-03-02 at 12:45 +0100, Philip Van Hoof wrote:
> > On Wed, 2005-03-02 at 12:19 +0100, Rodrigo Moya wrote: 
> > > On Wed, 2005-03-02 at 09:26 +0100, Philip Van Hoof wrote:
> > > > On Wed, 2005-03-02 at 11:03 +0800, Not Zed wrote:
> > > > 
> > > > 
> > > looks good to me
> > 
> > Committed
> > 
> > http://cvs.gnome.org/viewcvs/evolution/plugins/save-calendar/csv-format.c?r1=text&tr1=1.3&r2=text&tr2=1.4&diff_format=h
> > 
> 
> This breaks string freeze.  Did you get approval from gnome-18n?
> 
no, he didn't AFAIK, so just reverted his 3 commits. Philip, please,
resend your patch CC'in gnome-i18n gnome org
-- 
Philip Van Hoof, Software Developer @ Cronos
home: me at freax dot org
gnome: pvanhoof at gnome dot org
work: philip dot vanhoof at cronos dot be
junk: philip dot vanhoof at gmail dot com
http://www.freax.be, http://www.freax.eu.org
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/save-calendar/ChangeLog,v
retrieving revision 1.15
retrieving revision 1.17
diff -u -r1.15 -r1.17
--- ChangeLog	2 Mar 2005 15:56:23 -0000	1.15
+++ ChangeLog	2 Mar 2005 18:24:54 -0000	1.17
@@ -1,12 +1,3 @@
-2005-03-02  Philip Van Hoof  <pvanhoof gnome org>
-
-        * rdf-format.c: Fixes for Bug #73099 and Bug #73098
-	* csv-format.c: Changed malloc to g_malloc and char to gchar
-	
-2005-03-02  Philip Van Hoof  <pvanhoof gnome org>
-
-	* csv-format.c: Fixes for Bug #73099 and Bug #73098
-	
 2005-02-24  Bj�Torkelsson  <torkel acc umu se>
 
 	* org-gnome-save-calendar.eplug.in: Fixed description and added
Index: csv-format.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/save-calendar/csv-format.c,v
retrieving revision 1.6
retrieving revision 1.9
diff -u -r1.6 -r1.9
--- csv-format.c	2 Mar 2005 16:00:26 -0000	1.6
+++ csv-format.c	2 Mar 2005 18:24:54 -0000	1.9
@@ -34,8 +34,6 @@
 #include <gtk/gtkstock.h>
 #include <gtk/gtk.h>
 #include <libedataserver/e-source.h>
-#include <libecal/e-cal-time-util.h>
-#include <libedataserver/e-util.h>
 #include <libedataserverui/e-source-selector.h>
 #include <libecal/e-cal.h>
 #include <calendar/gui/e-cal-popup.h>
@@ -157,34 +155,25 @@
 static GString *
 add_time_to_csv (GString *line, icaltimetype *time, CsvConfig *config)
 {
+	/*
+	 * Perhaps we should check for quotes, delimiter and newlines in the
+	 * resulting string: The translators can put it there!
+	 *
+	 * Or perhaps we shouldn't make this translatable?
+	 * Or perhaps there is a library-function to do this?
+	 */
 
 	if (time) {
-		gboolean needquotes = FALSE;
-		struct tm mytm =  icaltimetype_to_tm (time);
-		gchar *str = (gchar*) g_malloc (sizeof (gchar) * 200);
-		
-		/* 
-		 * Translator: the %F %T is the thirth argument for a strftime function.
-		 * It lets you define the formatting of the date in the csv-file.
-		 * */
-		e_utf8_strftime (str, 200, _("%F %T"), &mytm);
-		
-		needquotes = string_needsquotes (str, config);
-		
-		if (needquotes)
-			line = g_string_append (line, config->quote);	
-		
-		line = g_string_append (line, str);
-		
-		if (needquotes)
-			line = g_string_append (line, config->quote);
-	
-		g_free (str);
-		
+		g_string_append_printf (line, _("%s%d/%s%d/%s%d %s%d:%s%d:%s%d"), 
+					(time->month < 10)?"0":"", time->month, 
+					(time->day < 10)?"0":"", time->day, 
+					(time->year < 10)?"0":"", time->year, 
+					(time->hour < 10)?"0":"", time->hour, 
+					(time->minute < 10)?"0":"", time->minute, 
+					(time->second < 10)?"0":"", time->second);
 	}
 
 	line = g_string_append (line, config->delimiter);
-
 	return line;
 }
 
@@ -363,7 +352,7 @@
 
 	result = gnome_vfs_open_uri (&handle, uri, GNOME_VFS_OPEN_READ);
 	if (result == GNOME_VFS_OK)
-		doit = e_error_run(GTK_WINDOW(gtk_widget_get_toplevel (GTK_WIDGET (target->selector))),
+		doit = e_error_run(gtk_widget_get_toplevel (GTK_WIDGET (target->selector)),
 			 E_ERROR_ASK_FILE_EXISTS_OVERWRITE, dest_uri, NULL) == GTK_RESPONSE_OK;
 
 	if (doit) {
@@ -377,37 +366,16 @@
 	if (result == GNOME_VFS_OK && doit && e_cal_get_object_list_as_comp (source_client, "#t", &objects, NULL)) {
 
 		if (config->header) {
-			
-			gint i=0;
-			
-			static gchar *labels[] = {
-				 N_("Uid"),
-				 N_("Summary"),
-				 N_("Description List"),
-				 N_("Categories List"),
-				 N_("Comment List"),
-				 N_("Completed"),
-				 N_("Created"),
-				 N_("Contact List"),
-				 N_("Start"),
-				 N_("End"),
-				 N_("Due"),
-				 N_("percent Done"),
-				 N_("Priority"),
-				 N_("Url"),
-				 N_("Attendees List"),
-				 N_("Location"),
-				 N_("Modified"),
-			};
-
 			line = g_string_new ("");
-			for (i=0;i<G_N_ELEMENTS(labels);i++) {
-				if (i>0)
-					line = g_string_append(line, config->delimiter);
-				line = g_string_append(line, _(labels[i]));
-			}
-			
-			line = g_string_append (line, config->newline);
+			g_string_append_printf (line, _("Uid%sSummary%sDescription List%sCategories List%s"
+							"Comment List%sCompleted%sCreated%sContact List%s"
+							"Start%sEnd%sDue%sPercent Done%sPriority%sUrl%s"
+							"Attendees List%sLocation%sModified%s"),
+						config->delimiter, config->delimiter, config->delimiter, config->delimiter, 
+						config->delimiter, config->delimiter, config->delimiter, config->delimiter, 
+						config->delimiter, config->delimiter, config->delimiter, config->delimiter, 
+						config->delimiter, config->delimiter, config->delimiter, config->delimiter, 
+						config->newline);
 
 			gnome_vfs_write (handle, line->str, line->len, NULL);
 			g_string_free (line, TRUE);
Index: rdf-format.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/save-calendar/rdf-format.c,v
retrieving revision 1.5
retrieving revision 1.7
diff -u -r1.5 -r1.7
--- rdf-format.c	2 Mar 2005 16:00:26 -0000	1.5
+++ rdf-format.c	2 Mar 2005 18:23:20 -0000	1.7
@@ -38,8 +38,6 @@
 #include <libecal/e-cal.h>
 #include <calendar/gui/e-cal-popup.h>
 #include <libgnomevfs/gnome-vfs.h>
-#include <libecal/e-cal-time-util.h>
-#include <libedataserver/e-util.h>
 #include <libxml/xmlmemory.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
@@ -63,18 +61,18 @@
 #define CALENDAR_CONFIG_PREFIX "/apps/evolution/calendar"
 #define CALENDAR_CONFIG_TIMEZONE CALENDAR_CONFIG_PREFIX "/display/timezone"
 
-static GConfClient *config = NULL;
+GConfClient *config = NULL;
 
 static gchar *
 calendar_config_get_timezone (void)
 {
-
 	gchar *retval = NULL;
 
 	if (!config)
 		config = gconf_client_get_default ();
 
 	retval = gconf_client_get_string (config, CALENDAR_CONFIG_TIMEZONE, NULL);
+
 	if (!retval) 
 		retval = g_strdup ("UTC");
 
@@ -145,17 +143,14 @@
 {
 	if (time) {
 		xmlNodePtr cur_node = NULL;
-		struct tm mytm =  icaltimetype_to_tm (time);
-		gchar *str = (gchar*) g_malloc (sizeof (gchar) * 200);
 		gchar *tmp = NULL;
-
-		/*
-		 * Translator: the %FT%T is the thirth argument for a strftime function.
-		 * It lets you define the formatting of the date in the rdf-file.
-		 * Also check out http://www.w3.org/2002/12/cal/tzd 
-		 * */
-		e_utf8_strftime (str, 200, _("%FT%T"), &mytm);
-
+		gchar *str = g_strdup_printf ("%s%d-%s%d-%s%dT%s%d:%s%d:%s%d", 
+					(time->year < 10)?"0":"", time->year, 
+					(time->month < 10)?"0":"", time->month, 
+					(time->day < 10)?"0":"", time->day, 
+					(time->hour < 10)?"0":"", time->hour, 
+					(time->minute < 10)?"0":"", time->minute, 
+					(time->second < 10)?"0":"", time->second);
 		cur_node = xmlNewChild (node, NULL, tag, str);
 
 		/* Not sure about this property */
@@ -222,7 +217,7 @@
 
 	result = gnome_vfs_open_uri (&handle, uri, GNOME_VFS_OPEN_READ);
 	if (result == GNOME_VFS_OK) 
-		doit = e_error_run(GTK_WINDOW(gtk_widget_get_toplevel (GTK_WIDGET (target->selector))),
+		doit = e_error_run(gtk_widget_get_toplevel (GTK_WIDGET (target->selector)),
 			 E_ERROR_ASK_FILE_EXISTS_OVERWRITE, dest_uri, NULL) == GTK_RESPONSE_OK;
 
 	if (doit) {


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