From 89fc82a8ab4fb0dd1b57888a877fa8078223fa89 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 18 Aug 2005 14:36:54 +0000 Subject: [PATCH] * calendar.c: finished preparing strings for i18n * sysmsgs.c: Save/Cancel buttons now have different element names, so we can do a "which element has a nonzero length" check instead of a "what is the value of this element" check. This is vital because the value equals the label, and the label will change if the language changes. This must be done throughout the system. --- webcit/ChangeLog | 9 ++++ webcit/calendar.c | 105 +++++++++++++++++++++++++++------------------- webcit/sysmsgs.c | 6 +-- 3 files changed, 74 insertions(+), 46 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index cf924bac5..eaf39f3e1 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,12 @@ $Log$ +Revision 621.13 2005/08/18 14:36:54 ajc +* calendar.c: finished preparing strings for i18n +* sysmsgs.c: Save/Cancel buttons now have different element names, so we + can do a "which element has a nonzero length" check instead of a "what + is the value of this element" check. This is vital because the value + equals the label, and the label will change if the language changes. + This must be done throughout the system. + Revision 621.12 2005/08/17 22:18:00 ajc * calendar.c: altered conflict reporting strings for better i18n @@ -2833,3 +2841,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/calendar.c b/webcit/calendar.c index 62b38d44b..49e572a90 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -249,15 +249,15 @@ void cal_process_object(icalcomponent *cal, /* Display the Accept/Decline buttons */ wprintf("How would you like to respond to this invitation?" "" - "Accept" + "%s" " | " - "Tentative" + "%s" " | " - "Decline" + "%s" "\n", - msgnum, cal_partnum, - msgnum, cal_partnum, - msgnum, cal_partnum + msgnum, cal_partnum, _("Accept"), + msgnum, cal_partnum, _("Tentative"), + msgnum, cal_partnum, _("Decline") ); } @@ -275,16 +275,16 @@ void cal_process_object(icalcomponent *cal, /* Display the update buttons */ wprintf("" - "Click Update to accept this reply and " - "update your calendar." + "%s" "" - "Update" + "%s" " | " - "Ignore" + "%s" "" "\n", - msgnum, cal_partnum, - msgnum, cal_partnum + _("Click Update to accept this reply and update your calendar."), + msgnum, cal_partnum, _("Update"), + msgnum, cal_partnum, _("Ignore") ); } @@ -307,7 +307,8 @@ void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) { cal = icalcomponent_new_from_string(part_source); if (cal == NULL) { - wprintf("Error parsing calendar object
\n"); + wprintf(_("There was an error parsing this calendar item.")); + wprintf("
\n"); return; } @@ -331,7 +332,9 @@ void respond_to_request(void) { wprintf("
\n"); wprintf("
" - "Respond to meeting request" + ""); + wprintf(_("Respond to meeting request")); + wprintf("" "
\n" ); wprintf("
\n
\n"); @@ -349,21 +352,21 @@ void respond_to_request(void) { "" ); if (!strcasecmp(bstr("sc"), "accept")) { - wprintf("You have accepted this meeting invitation. " - "It has been entered into your calendar, " + wprintf(_("You have accepted this meeting invitation. " + "It has been entered into your calendar.") ); } else if (!strcasecmp(bstr("sc"), "tentative")) { - wprintf("You have tentatively accepted this meeting invitation. " - "It has been 'pencilled in' to your calendar, " + wprintf(_("You have tentatively accepted this meeting invitation. " + "It has been 'pencilled in' to your calendar.") ); } else if (!strcasecmp(bstr("sc"), "decline")) { - wprintf("You have declined this meeting invitation. " - "It has not been entered into your calendar, " + wprintf(_("You have declined this meeting invitation. " + "It has not been entered into your calendar.") ); } - wprintf("and a reply has been sent to the meeting organizer." - "\n" - ); + wprintf(" "); + wprintf(_("A reply has been sent to the meeting organizer.")); + wprintf("\n"); } else { wprintf("" "%s\n", &buf[4]); @@ -371,7 +374,9 @@ void respond_to_request(void) { wprintf("wc_roomname); - wprintf("\">
Return to messages

\n"); + wprintf("\">
"); + wprintf(_("Return to messages")); + wprintf("
\n"); wDumpContent(1); } @@ -388,8 +393,9 @@ void handle_rsvp(void) { wprintf("
\n"); wprintf("
" - "" - "Update your calendar with this RSVP" + ""); + wprintf(_("Update your calendar with this RSVP")); + wprintf("" "
\n" "
\n
\n" ); @@ -407,12 +413,10 @@ void handle_rsvp(void) { "" ); if (!strcasecmp(bstr("sc"), "update")) { - wprintf("Your calendar has been updated " - "to reflect this RSVP." - ); + wprintf(_("Your calendar has been updated to reflect this RSVP.")); } else if (!strcasecmp(bstr("sc"), "ignore")) { - wprintf("You have chosen to ignore this RSVP. " - "Your calendar has not been updated." + wprintf(_("You have chosen to ignore this RSVP. " + "Your calendar has not been updated.") ); } wprintf("\n" @@ -424,7 +428,9 @@ void handle_rsvp(void) { wprintf("wc_roomname); - wprintf("\">
Return to messages

\n"); + wprintf("\">
"); + wprintf(_("Return to messages")); + wprintf("
\n"); wDumpContent(1); } @@ -500,7 +506,9 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) { wprintf("
\n" "" "" - "
Edit task" + ""); + wprintf(_("Edit task")); + wprintf("" "
\n" "
\n
\n" ); @@ -514,7 +522,9 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) { wprintf("\n"); - wprintf("\n"); - wprintf("\n"); - wprintf("\n"); - wprintf("
Summary:" + wprintf("
"); + wprintf(_("Summary:")); + wprintf("" "
Start date:"); + wprintf("
"); + wprintf(_("Start date:")); + wprintf(""); p = icalcomponent_get_first_property(vtodo, ICAL_DTSTART_PROPERTY); if (p != NULL) { t = icalproperty_get_dtstart(p); @@ -534,7 +546,9 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) { display_icaltimetype_as_webform(&t, "dtstart"); wprintf("
Due date:"); + wprintf("
"); + wprintf(_("Due date:")); + wprintf(""); p = icalcomponent_get_first_property(vtodo, ICAL_DUE_PROPERTY); if (p != NULL) { t = icalproperty_get_due(p); @@ -544,7 +558,9 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) { } display_icaltimetype_as_webform(&t, "due"); wprintf("
Description:"); + wprintf("
"); + wprintf(_("Description:")); + wprintf(""); wprintf("
\n"); wprintf("
" - "" + "" "  " - "\n" + "\n" "  " - "\n" - "
\n" + "\n" + "\n", + _("Save"), + _("Delete"), + _("Cancel") ); wprintf("\n"); @@ -610,7 +629,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) { created_new_vtodo = 1; } - if (!strcasecmp(bstr("sc"), "Save")) { + if (strlen(bstr("save_button")) > 0) { /* Replace values in the component with ones from the form */ @@ -707,7 +726,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) { /* * If the user clicked 'Delete' then explicitly delete the message. */ - if (!strcasecmp(bstr("sc"), "Delete")) { + if (strlen(bstr("delete_button")) > 0) { delete_existing = 1; } diff --git a/webcit/sysmsgs.c b/webcit/sysmsgs.c index fa1fcf45a..b2ba73f89 100644 --- a/webcit/sysmsgs.c +++ b/webcit/sysmsgs.c @@ -46,9 +46,9 @@ void display_edit(char *description, char *check_cmd, if (buf[0] == '1') server_to_text(); wprintf("

\n"); - wprintf(""); + wprintf(""); wprintf(" "); - wprintf("
\n"); + wprintf("
\n"); wprintf("\n"); do_template("endbox"); @@ -63,7 +63,7 @@ void save_edit(char *description, char *enter_cmd, int regoto) { char buf[SIZ]; - if (strcmp(bstr("sc"), "Save")) { + if (strlen(bstr("save_button")) == 0) { sprintf(WC->ImportantMessage, "Cancelled. %s was not saved.\n", description); display_main_menu(); -- 2.39.2