Re: [evolution-patches] New patch for 43558



Rodrigao!
This patch was important for Sun. I hope you can review it ASAP

This patch worked well on my computer.

Thanks
jack
Suresh Chandrasekharan wrote:

Hi All,
	I have sent a patch for 43558, one week early or so, though this is
approved, not till committed to evolution-1-4-branch, testing with the
messages files ( zh_CN ). I have found that not only e-time-utils.c
needs patching but also zh_CN.po for the right behaviour. The strptime
format strings given in zh_CN.po do contain illegal '-'s which also was
creating an issue.

So pl. check this patch.

Thanks,
Suresh
------------------------------------------------------------------------

Index: e-util/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/e-util/ChangeLog,v
retrieving revision 1.398.2.2
diff -u -r1.398.2.2 ChangeLog
--- e-util/ChangeLog	30 Jul 2003 12:58:32 -0000	1.398.2.2
+++ e-util/ChangeLog	7 Aug 2003 01:09:51 -0000
@@ -1,3 +1,9 @@
+2003-07-28  Suresh Chandrasekharan  <suresh chandrasekharan sun com>
+
+ * e-time-utils.c (parse_with_strptime): Fixes #43558 Appointment + Editor always gives time validation error for apptmnts in non + UTF-8/non ASCII locales.
+
2003-07-29  Dan Winship  <danw ximian com>

	* e-gui-utils.c (e_icon_for_mime_type): New function to return an
Index: e-util/e-time-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-time-utils.c,v
retrieving revision 1.15
diff -u -r1.15 e-time-utils.c
--- e-util/e-time-utils.c	30 May 2003 17:32:52 -0000	1.15
+++ e-util/e-time-utils.c	7 Aug 2003 01:09:51 -0000
@@ -17,6 +17,7 @@

#include <time.h>
#include <sys/time.h>
+#include <gal/widgets/e-unicode.h>

#ifdef __linux__
#undef _GNU_SOURCE
@@ -58,6 +59,9 @@
parse_with_strptime (const char *value, struct tm *result, const char **formats, int n_formats)
{
	const char *parse_end = NULL, *pos;
+	gchar *locale_str;
+	gchar *format_str;
+	ETimeParseStatus parse_ret;
	gboolean parsed = FALSE;
	int i;

@@ -66,8 +70,10 @@
		result->tm_isdst = -1;
		return E_TIME_PARSE_NONE;
	}
+	
+	locale_str = e_utf8_to_locale_string (value);

-	pos = value;
+	pos = (const char *) locale_str;

	/* Skip whitespace */
	while (isspace (*pos))
@@ -77,7 +83,9 @@

	for (i = 0; i < n_formats; i++) {
		memset (result, 0, sizeof (*result));
-		parse_end = strptime (pos, formats[i], result);
+		format_str = e_utf8_to_locale_string (formats[i]);
+		parse_end = strptime (pos, format_str, result);
+		g_free (format_str);
		if (parse_end) {
			parsed = TRUE;
			break;
@@ -86,6 +94,8 @@

	result->tm_isdst = -1;

+	parse_ret =  E_TIME_PARSE_INVALID;
+
	/* If we parsed something, make sure we parsed the entire string. */
	if (parsed) {
		/* Skip whitespace */
@@ -93,10 +103,13 @@
			parse_end++;

		if (*parse_end == '\0')
-			return E_TIME_PARSE_OK;
+			parse_ret = E_TIME_PARSE_OK;
	}

-	return E_TIME_PARSE_INVALID;
+	g_free (locale_str);
+
+	return (parse_ret);
+
}


Index: po/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/po/ChangeLog,v
retrieving revision 1.1125.2.37
diff -u -r1.1125.2.37 ChangeLog
--- po/ChangeLog	6 Aug 2003 12:41:14 -0000	1.1125.2.37
+++ po/ChangeLog	7 Aug 2003 01:09:51 -0000
@@ -1,3 +1,7 @@
+2003-08-06  Suresh Chandrasekharan <suresh chandrasekharan sun com>
+
+	* zh_CN.po: Removed illegal '-'s from strptime msgstr
+
2003-08-06  Christian Rose  <menthos menthos com>

	* sv.po: Updated Swedish translation.
Index: po/zh_CN.po
===================================================================
RCS file: /cvs/gnome/evolution/po/zh_CN.po,v
retrieving revision 1.36.2.4
diff -u -r1.36.2.4 zh_CN.po
--- po/zh_CN.po	6 Aug 2003 16:37:12 -0000	1.36.2.4
+++ po/zh_CN.po	7 Aug 2003 01:09:53 -0000
@@ -5988,7 +5988,7 @@
#: calendar/gui/e-meeting-time-sel-item.c:466 e-util/e-time-utils.c:225
#: e-util/e-time-utils.c:286 widgets/misc/e-dateedit.c:1582
msgid "%m/%d/%Y"
-msgstr "%Y年%-m月%-d日"
+msgstr "%Y年%m月%d日"

#: calendar/gui/e-meeting-time-sel.c:407 designs/OOA/ooa.glade.h:11
msgid "Out of Office"
@@ -10794,30 +10794,30 @@
#. in 12-hour format, without seconds.
#: e-util/e-time-utils.c:172 e-util/e-time-utils.c:385
msgid "%a %m/%d/%Y %I:%M %p"
-msgstr "%Y/%-m/%-d %A %p %-I:%M"
+msgstr "%Y/%m/%d %A %p %I:%M"

#. strptime format of a weekday, a date and a time,
#. in 24-hour format, without seconds.
#: e-util/e-time-utils.c:177 e-util/e-time-utils.c:376
msgid "%a %m/%d/%Y %H:%M"
-msgstr "%Y/%-m/%-d %A %-H:%M"
+msgstr "%Y/%m/%d %A %H:%M"

#. strptime format of a weekday, a date and a time,
#. in 12-hour format, without minutes or seconds.
#: e-util/e-time-utils.c:182
msgid "%a %m/%d/%Y %I %p"
-msgstr "%Y/%-m/%-d %A %p %I点"
+msgstr "%Y/%m/%d %A %p %I点"

#. strptime format of a weekday, a date and a time,
#. in 24-hour format, without minutes or seconds.
#: e-util/e-time-utils.c:187
msgid "%a %m/%d/%Y %H"
-msgstr "%Y/%-m/%-d %A %-H点"
+msgstr "%Y/%m/%d %A %H点"

#. strptime format of a date and a time, in 12-hour format.
#: e-util/e-time-utils.c:198
msgid "%m/%d/%Y %I:%M:%S %p"
-msgstr "%Y/%-m/%-d %p %-I:%M:%S"
+msgstr "%Y/%m/%d %p %I:%M:%S"

#. strptime format of a date and a time, in 24-hour format.
#: e-util/e-time-utils.c:202
@@ -10834,42 +10834,42 @@
#. without seconds.
#: e-util/e-time-utils.c:212
msgid "%m/%d/%Y %H:%M"
-msgstr "%Y/%-m/%-d %-H:%M"
+msgstr "%Y/%m/%d %H:%M"

#. strptime format of a date and a time, in 12-hour format,
#. without minutes or seconds.
#: e-util/e-time-utils.c:217
msgid "%m/%d/%Y %I %p"
-msgstr "%Y/%-m/%-d %p %-I点"
+msgstr "%Y/%m/%d %p %I点"

#. strptime format of a date and a time, in 24-hour format,
#. without minutes or seconds.
#: e-util/e-time-utils.c:222
msgid "%m/%d/%Y %H"
-msgstr "%Y/%-m/%-d %-H点"
+msgstr "%Y/%m/%d %H点"

#. strptime format for a time of day, in 12-hour format.
#: e-util/e-time-utils.c:326 e-util/e-time-utils.c:425
msgid "%I:%M:%S %p"
-msgstr "%p %-I:%M:%S"
+msgstr "%p %I:%M:%S"

#. strptime format for a time of day, in 24-hour format.
#: e-util/e-time-utils.c:330 e-util/e-time-utils.c:417
msgid "%H:%M:%S"
-msgstr "%-H:%M:%S"
+msgstr "%H:%M:%S"

#. strptime format for time of day, without seconds,
#. in 12-hour format.
#: e-util/e-time-utils.c:335 e-util/e-time-utils.c:422
#: widgets/misc/e-dateedit.c:1404 widgets/misc/e-dateedit.c:1617
msgid "%I:%M %p"
-msgstr "%p %-I:%M"
+msgstr "%p %I:%M"

#. strptime format for time of day, without seconds 24-hour format.
#: e-util/e-time-utils.c:339 e-util/e-time-utils.c:414
#: widgets/misc/e-dateedit.c:1401 widgets/misc/e-dateedit.c:1614
msgid "%H:%M"
-msgstr "%-H:%M"
+msgstr "%H:%M"

#. strptime format for hour and AM/PM, 12-hour format.
#: e-util/e-time-utils.c:343





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