From 3b577252a7df4ac4c63b1c9861ee789877b3c06e Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Fri, 26 Oct 2001 00:42:10 +0000 Subject: used functions to get PUBLISH_OPTIONS etc., so we can translate them. 2001-10-25 Damon Chaplin * gui/e-itip-control.c: used functions to get PUBLISH_OPTIONS etc., so we can translate them. svn path=/trunk/; revision=14115 --- calendar/ChangeLog | 5 ++ calendar/gui/e-itip-control.c | 143 +++++++++++++++++++++++++++++++++++------- 2 files changed, 125 insertions(+), 23 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 9140cc885f..75f604f402 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +2001-10-25 Damon Chaplin + + * gui/e-itip-control.c: used functions to get PUBLISH_OPTIONS etc., + so we can translate them. + 2001-10-25 Damon Chaplin * cal-util/cal-recur.c (cal_obj_bysetpos_filter): subtract 1 from diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index b85e113170..5170a162be 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -76,12 +76,14 @@ struct _EItipControlPrivate { }; /* HTML Strings */ -#define HTML_HEADER "iCalendar Information" #define HTML_BODY_START "" #define HTML_SEP "
" #define HTML_BODY_END "" #define HTML_FOOTER "" +/* We don't use these now, as we need to be able to translate the text. + But I've left these here, in case there are problems with the new code. */ +#if 0 #define PUBLISH_OPTIONS "
Choose an action:     \
" @@ -109,7 +111,7 @@ struct _EItipControlPrivate { #define CANCEL_OPTIONS "
Choose an action:    \
" - +#endif static void class_init (EItipControlClass *klass); static void init (EItipControl *itip); @@ -556,14 +558,15 @@ write_error_html (EItipControl *itip, const gchar *itip_err) { EItipControlPrivate *priv; GtkHTMLStream *html_stream; - gchar *html; priv = itip->priv; /* Html widget */ html_stream = gtk_html_begin (GTK_HTML (priv->html)); - gtk_html_write (GTK_HTML (priv->html), html_stream, - HTML_HEADER, strlen(HTML_HEADER)); + gtk_html_stream_printf (html_stream, + "%s", + U_("iCalendar Information")); + gtk_html_write (GTK_HTML (priv->html), html_stream, HTML_BODY_START, strlen(HTML_BODY_START)); @@ -609,8 +612,9 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, /* Html widget */ html_stream = gtk_html_begin (GTK_HTML (priv->html)); - gtk_html_write (GTK_HTML (priv->html), html_stream, - HTML_HEADER, strlen(HTML_HEADER)); + gtk_html_stream_printf (html_stream, + "%s", + U_("iCalendar Information")); gtk_html_write (GTK_HTML (priv->html), html_stream, HTML_BODY_START, strlen(HTML_BODY_START)); @@ -712,11 +716,99 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, } +static char* +get_publish_options () +{ + return g_strdup_printf ("
%s " + "    " + "" + "
", + U_("Choose an action:"), + U_("Update"), + U_("OK")); +} + +static char* +get_request_options () +{ + return g_strdup_printf ("
%s " + "  " + "%s  " + "
" + "
", + U_("Choose an action:"), + U_("Accept"), + U_("Tentatively accept"), + U_("Decline"), + U_("RSVP"), + U_("OK")); +} + +static char* +get_request_fb_options () +{ + return g_strdup_printf ("
%s " + "    " + "" + "
", + U_("Choose an action:"), + U_("Send Free/Busy Information"), + U_("OK")); +} + +static char* +get_reply_options () +{ + return g_strdup_printf ("
%s " + "    " + "" + "
", + U_("Choose an action:"), + U_("Update respondent status"), + U_("OK")); +} + +#if 0 +static char* +get_refresh_options () +{ + return g_strdup_printf ("
%s " + "    " + "" + "
", + U_("Choose an action:"), + U_("Send Latest Information"), + U_("OK")); +} +#endif + +static char* +get_cancel_options () +{ + return g_strdup_printf ("
%s " + "    " + "" + "
", + U_("Choose an action:"), + U_("Cancel"), + U_("OK")); +} + static void show_current_event (EItipControl *itip) { EItipControlPrivate *priv; - const gchar *itip_title, *itip_desc, *options; + const gchar *itip_title, *itip_desc; + char *options; priv = itip->priv; @@ -724,32 +816,32 @@ show_current_event (EItipControl *itip) case ICAL_METHOD_PUBLISH: itip_desc = U_("%s has published meeting information."); itip_title = U_("Meeting Information"); - options = PUBLISH_OPTIONS; + options = get_publish_options (); break; case ICAL_METHOD_REQUEST: itip_desc = U_("%s requests your presence at a meeting."); itip_title = U_("Meeting Proposal"); - options = REQUEST_OPTIONS; + options = get_request_options (); break; case ICAL_METHOD_ADD: itip_desc = U_("%s wishes to add to an existing meeting."); itip_title = U_("Meeting Update"); - options = PUBLISH_OPTIONS; + options = get_publish_options (); break; case ICAL_METHOD_REFRESH: itip_desc = U_("%s wishes to receive the latest meeting information."); itip_title = U_("Meeting Update Request"); - options = PUBLISH_OPTIONS; + options = get_publish_options (); break; case ICAL_METHOD_REPLY: itip_desc = U_("%s has replied to a meeting request."); itip_title = U_("Meeting Reply"); - options = REPLY_OPTIONS; + options = get_reply_options (); break; case ICAL_METHOD_CANCEL: itip_desc = U_("%s has cancelled a meeting."); itip_title = U_("Meeting Cancellation"); - options = CANCEL_OPTIONS; + options = get_cancel_options (); break; default: itip_desc = U_("%s has sent an unintelligible message."); @@ -758,13 +850,15 @@ show_current_event (EItipControl *itip) } write_html (itip, itip_desc, itip_title, options); + g_free (options); } static void show_current_todo (EItipControl *itip) { EItipControlPrivate *priv; - const gchar *itip_title, *itip_desc, *options; + const gchar *itip_title, *itip_desc; + char *options; priv = itip->priv; @@ -772,32 +866,32 @@ show_current_todo (EItipControl *itip) case ICAL_METHOD_PUBLISH: itip_desc = U_("%s has published task information."); itip_title = U_("Task Information"); - options = PUBLISH_OPTIONS; + options = get_publish_options (); break; case ICAL_METHOD_REQUEST: itip_desc = U_("%s requests you perform a task."); itip_title = U_("Task Proposal"); - options = REQUEST_OPTIONS; + options = get_request_options (); break; case ICAL_METHOD_ADD: itip_desc = U_("%s wishes to add to an existing task."); itip_title = U_("Task Update"); - options = PUBLISH_OPTIONS; + options = get_publish_options (); break; case ICAL_METHOD_REFRESH: itip_desc = U_("%s wishes to receive the latest task information."); itip_title = U_("Task Update Request"); - options = PUBLISH_OPTIONS; + options = get_publish_options (); break; case ICAL_METHOD_REPLY: itip_desc = U_("%s has replied to a task assignment."); itip_title = U_("Task Reply"); - options = REPLY_OPTIONS; + options = get_reply_options (); break; case ICAL_METHOD_CANCEL: itip_desc = U_("%s has cancelled a task."); itip_title = U_("Task Cancellation"); - options = CANCEL_OPTIONS; + options = get_cancel_options (); break; default: itip_desc = U_("%s has sent an unintelligible message."); @@ -806,13 +900,15 @@ show_current_todo (EItipControl *itip) } write_html (itip, itip_desc, itip_title, options); + g_free (options); } static void show_current_freebusy (EItipControl *itip) { EItipControlPrivate *priv; - const gchar *itip_title, *itip_desc, *options; + const gchar *itip_title, *itip_desc; + char *options; priv = itip->priv; @@ -825,7 +921,7 @@ show_current_freebusy (EItipControl *itip) case ICAL_METHOD_REQUEST: itip_desc = U_("%s requests your free/busy information."); itip_title = U_("Free/Busy Request"); - options = REQUEST_FB_OPTIONS; + options = get_request_fb_options (); break; case ICAL_METHOD_REPLY: itip_desc = U_("%s has replied to a free/busy request."); @@ -839,6 +935,7 @@ show_current_freebusy (EItipControl *itip) } write_html (itip, itip_desc, itip_title, options); + g_free (options); } static icalcomponent * -- cgit