diff options
-rw-r--r-- | my-evolution/ChangeLog | 19 | ||||
-rw-r--r-- | my-evolution/e-summary-calendar.c | 26 | ||||
-rw-r--r-- | my-evolution/e-summary-mail.c | 16 | ||||
-rw-r--r-- | my-evolution/e-summary-rdf.c | 14 | ||||
-rw-r--r-- | my-evolution/e-summary-weather.c | 29 |
5 files changed, 80 insertions, 24 deletions
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 0bdf41d197..8935cd8a09 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,22 @@ +2001-06-30 Zbigniew Chyla <cyba@gnome.pl> + + * e-summary-calendar.c (generate_html): + Marked strings for translation + conversion to utf8. + + * e-summary-mail.c + Added missing #include <config.h> + (e_summary_mail_generate_html): + Marked strings for translation + conversion to utf8. + + * e-summary-weather.c + (e_summary_weather_get_html, open_callback): + Marked strings for translation + conversion to utf8. + (weather_make_html): Fixed leaks. + + * e-summary-rdf.c + (tree_walk): Fixed leaks. + (read_callback): Marked strings for translation. + 2001-06-29 Iain Holmes <iain@ximian.com> * e-summary.c (e_summary_draw): Resurrect the hack to stop GtkHTML from diff --git a/my-evolution/e-summary-calendar.c b/my-evolution/e-summary-calendar.c index 3bc2b21f46..71e3e4670b 100644 --- a/my-evolution/e-summary-calendar.c +++ b/my-evolution/e-summary-calendar.c @@ -11,6 +11,7 @@ #endif #include <gnome.h> +#include <gal/widgets/e-unicode.h> #include "e-summary-calendar.h" #include "e-summary.h" @@ -152,21 +153,30 @@ generate_html (gpointer data) CALOBJ_TYPE_EVENT, day_begin, day_end); if (uids == NULL) { - if (calendar->html) { - g_free (calendar->html); - } - calendar->html = g_strdup ("<dl><dt><img src=\"ico-calendar.png\" align=\"middle\" " - "alt=\"\" width=\"48\" height=\"48\"> <b><a href=\"evolution:/local/Calendar\">Appointments</a>" - "</b></dt><dd><b>No appointments</b></dd></dl>"); + char *s1, *s2; + + s1 = e_utf8_from_locale_string (_("Appointments")); + s2 = e_utf8_from_locale_string (_("No appointments")); + g_free (calendar->html); + calendar->html = g_strconcat ("<dl><dt><img src=\"ico-calendar.png\" align=\"middle\" " + "alt=\"\" width=\"48\" height=\"48\"> <b><a href=\"evolution:/local/Calendar\">", + s1, "</a></b></dt><dd><b>", s2, "</b></dd></dl>", NULL); + g_free (s1); + g_free (s2); e_summary_draw (summary); return FALSE; } else { + char *s; + uids = cal_list_sort (uids, sort_uids, summary); string = g_string_new ("<dl><dt><img src=\"ico-calendar.png\" align=\"middle\" " - "alt=\"\" width=\"48\" height=\"48\"> <b><a href=\"evolution:/local/Calendar\">Appointments</a>" - "</b></dt><dd>"); + "alt=\"\" width=\"48\" height=\"48\"> <b><a href=\"evolution:/local/Calendar\">"); + s = e_utf8_from_locale_string (_("Appointments")); + g_string_append (string, s); + g_free (s); + g_string_append (string, "</a></b></dt><dd>"); for (l = uids; l; l = l->next) { char *uid, *start_str; CalComponent *comp; diff --git a/my-evolution/e-summary-mail.c b/my-evolution/e-summary-mail.c index 2453a93d6a..4ce4fd90c9 100644 --- a/my-evolution/e-summary-mail.c +++ b/my-evolution/e-summary-mail.c @@ -6,12 +6,18 @@ * Authors: Iain Holmes <iain@ximian.com> */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <liboaf/liboaf.h> +#include <gal/widgets/e-unicode.h> #include "Mail.h" #include "e-summary.h" #include "e-summary-mail.h" +#include <libgnome/gnome-defs.h> +#include <libgnome/gnome-i18n.h> #include <gtk/gtksignal.h> #include <bonobo/bonobo-exception.h> #include <bonobo/bonobo-listener.h> @@ -85,12 +91,16 @@ e_summary_mail_generate_html (ESummary *summary) ESummaryMail *mail; GString *string; GList *p; + gchar *s; mail = summary->mail; string = g_string_new ("<dl><dt><img src=\"ico-mail.png\" " - "align=\"middle\" alt=\"\" width=\"48\" " - "height=\"48\"> <b><a href=\"evolution:/local/Inbox\">Mail summary</a>" - "</b></dt><dd><table numcols=\"2\" width=\"100%\">"); + "align=\"middle\" alt=\"\" width=\"48\" " + "height=\"48\"> <b><a href=\"evolution:/local/Inbox\">"); + s = e_utf8_from_locale_string (_("Mail summary")); + g_string_append (string, s); + g_free (s); + g_string_append (string, "</a></b></dt><dd><table numcols=\"2\" width=\"100%\">"); for (p = mail->shown; p; p = p->next) { folder_gen_html (p->data, string); diff --git a/my-evolution/e-summary-rdf.c b/my-evolution/e-summary-rdf.c index 0980640542..0cd7bb8c33 100644 --- a/my-evolution/e-summary-rdf.c +++ b/my-evolution/e-summary-rdf.c @@ -18,6 +18,8 @@ #include <gnome-xml/parser.h> #include <gnome-xml/xmlmemory.h> +#include <libgnome/gnome-defs.h> +#include <libgnome/gnome-i18n.h> #include <gal/widgets/e-unicode.h> #include <libgnomevfs/gnome-vfs.h> #include "e-summary.h" @@ -235,7 +237,9 @@ tree_walk (xmlNodePtr root, full = g_strdup_printf ("<a href=\"%s\">", u); g_string_append (html, full); } - g_string_append (html, e_utf8_from_locale_string (t)); + t = e_utf8_from_locale_string (t); + g_string_append (html, t); + g_free (t); if (*u != '\0') { g_string_append (html, "</a>"); } @@ -284,7 +288,9 @@ tree_walk (xmlNodePtr root, g_free (tmp); } - tmp = g_strdup_printf ("%s\n</A></font></li>", e_utf8_from_locale_string (p)); + p = e_utf8_from_locale_string (p); + tmp = g_strdup_printf ("%s\n</A></font></li>", p); + g_free (p); g_string_append (html, tmp); g_free (tmp); } @@ -361,7 +367,7 @@ read_callback (GnomeVFSAsyncHandle *handle, RDF *r) { if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) { - r->html = g_strdup ("<b>Error downloading RDF</b>"); + r->html = e_utf8_from_locale_string (_("<b>Error downloading RDF</b>")); e_summary_draw (r->summary); r->handle = NULL; @@ -387,7 +393,7 @@ open_callback (GnomeVFSAsyncHandle *handle, RDF *r) { if (result != GNOME_VFS_OK) { - r->html = g_strdup ("<b>Error downloading RDF</b>"); + r->html = e_utf8_from_locale_string (_("<b>Error downloading RDF</b>")); e_summary_draw (r->summary); return; diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c index ebe6158e95..ed8847f1eb 100644 --- a/my-evolution/e-summary-weather.c +++ b/my-evolution/e-summary-weather.c @@ -41,14 +41,19 @@ e_summary_weather_get_html (ESummary *summary) GList *weathers; GString *string; char *html; + char *s; if (summary->weather == NULL) { return NULL; } string = g_string_new ("<dl><img src=\"ico-weather.png\" align=\"middle\" " - "alt=\"\" width=\"48\" height=\"48\"><b>" - "<a href=\"http://www.metoffice.gov.uk\">My Weather</a></b>"); + "alt=\"\" width=\"48\" height=\"48\"><b>" + "<a href=\"http://www.metoffice.gov.uk\">"); + s = e_utf8_from_locale_string (_("My Weather")); + g_string_append (string, s); + g_free (s); + g_string_append (string, "</a></b>"); for (weathers = summary->weather->weathers; weathers; weathers = weathers->next) { if (((Weather *)weathers->data)->html == NULL) { continue; @@ -77,7 +82,7 @@ weather_make_html (Weather *w) { GString *string; ESummaryWeatherLocation *location; - char *sky, *temp, *cond, *uri, *url; + char *sky, *temp, *cond, *uri, *url, *s; string = g_string_new ("<dd><img align=\"middle\" " "src=\"es-weather.png\"> <b>"); @@ -96,11 +101,17 @@ weather_make_html (Weather *w) temp = weather_temp_string (w); cond = (char *) weather_conditions_string (w); - g_string_append (string, e_utf8_from_locale_string (sky)); - g_string_append (string, " "); - g_string_append (string, e_utf8_from_locale_string (cond)); - g_string_append (string, " "); - g_string_append (string, e_utf8_from_locale_string (temp)); + s = e_utf8_from_locale_string (sky); + g_string_append (string, s); + g_free (s); + g_string_append_c (string, ' '); + s = e_utf8_from_locale_string (cond); + g_string_append (string, s); + g_free (s); + g_string_append_c (string, ' '); + s = e_utf8_from_locale_string (temp); + g_string_append (string, s); + g_free (s); g_free (temp); g_string_append (string, "<font size=\"-1\">"); @@ -274,7 +285,7 @@ open_callback (GnomeVFSAsyncHandle *handle, Weather *w) { if (result != GNOME_VFS_OK) { - w->html = g_strdup ("<b>Error downloading Metar</b>"); + w->html = e_utf8_from_locale_string (_("<b>Error downloading Metar</b>")); e_summary_draw (w->summary); return; |