From 3bd35c2e49089f725c1624a084c7d4ee4b50193d Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 22 Aug 2005 21:22:00 +0000 Subject: [PATCH] * vcard_edit.c webcit.c webserver.c who.c : i18n * This should complete the internationalization of the entire WebCit package. Testing must be done, and then of course we must have someone do a translation so we can see if this thing works. --- webcit/ChangeLog | 7 +++ webcit/vcard_edit.c | 80 ++++++++++++++++++++++------------ webcit/webcit.c | 63 +++++++++++---------------- webcit/webserver.c | 6 +-- webcit/who.c | 104 ++++++++++++++++++++++++-------------------- 5 files changed, 144 insertions(+), 116 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 0fb2f1afd..27588f24f 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,10 @@ $Log$ +Revision 621.29 2005/08/22 21:22:00 ajc +* vcard_edit.c webcit.c webserver.c who.c : i18n +* This should complete the internationalization of the entire WebCit + package. Testing must be done, and then of course we must have someone + do a translation so we can see if this thing works. + Revision 621.28 2005/08/22 20:27:26 ajc * userlist.c: i18n * vcard.c: minor change to comments in code @@ -2893,3 +2899,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index 736eb806f..d3d8a8f67 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -1,14 +1,13 @@ /* * $Id$ * - * Handles editing of vCard objects. + * Handles on-screen editing of vCard objects. * */ #include "webcit.h" #include "vcard.h" - /* Edit the vCard component of a MIME message. Supply the message number * and MIME part number to fetch. Or, specify -1 for the message number * to start with a blank card. @@ -69,7 +68,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { serv_puts(buf); serv_getln(buf, sizeof buf); if (buf[0] != '1') { - convenience_page("770000", "Error", &buf[4]); + convenience_page("770000", _("Error"), &buf[4]); return; } while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { @@ -170,9 +169,9 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { wprintf("
\n" "
" "" - "" - "Edit contact information" - "" + ""); + wprintf(_("Edit contact information")); + wprintf("" "
\n" "
\n
\n" ); @@ -182,11 +181,13 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { "
\n"); wprintf("" - "" - "" - "" - "" - "\n"); + "" + "" + "" + "" + "\n", + _("Prefix"), _("First"), _("Middle"), _("Last"), _("Suffix") + ); wprintf("", prefix); @@ -206,13 +207,15 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { wprintf("
PrefixFirstMiddleLastSuffix
%s%s%s%s%s
"); wprintf("
"); - wprintf("Title:
" + wprintf(_("Title:")); + wprintf("
" "

\n", title ); - wprintf("Organization:
" + wprintf(_("Organization:")); + wprintf("
" "

\n", org @@ -221,11 +224,15 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { wprintf("
"); wprintf(""); - wprintf("\n", pobox); - wprintf("\n", extadr); @@ -233,19 +240,27 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { "\n", street); - wprintf("\n", city); - wprintf("\n", state); - wprintf("\n", zipcode); - wprintf("\n", country); @@ -253,11 +268,15 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { wprintf("
PO box:" + wprintf("
"); + wprintf(_("PO box:")); + wprintf("" "
Address:" + wprintf("
"); + wprintf(_("Address:")); + wprintf("" "
City:" + wprintf("
"); + wprintf(_("City:")); + wprintf("" "
State:" + wprintf("
"); + wprintf(_("State:")); + wprintf("" "
ZIP code:" + wprintf("
"); + wprintf(_("ZIP code:")); + wprintf("" "
Country:" + wprintf("
"); + wprintf(_("Country:")); + wprintf("" "
\n"); - wprintf("" + wprintf("
Home telephone:
" "\n", hometel); - wprintf("" + wprintf("" "
"); + wprintf(_("Home telephone:")); + wprintf("Work telephone:"); + wprintf(_("Work telephone:")); + wprintf("
\n", worktel); @@ -266,13 +285,16 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { wprintf("
"); wprintf("" - "
Primary Internet e-mail address
" + "
"); + wprintf(_("Primary Internet e-mail address")); + wprintf("
" "
" - "
" - "Internet e-mail aliases
" + "
"); + wprintf(_("Internet e-mail aliases")); + wprintf("
" "
\n"); @@ -288,10 +310,12 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { wprintf("\">\n"); wprintf("
\n" - "" + "" " " - "" - "
\n" + "" + "\n", + _("Save changes"), + _("Cancel") ); wprintf("
\n"); @@ -316,7 +340,7 @@ void submit_vcard(void) { char buf[SIZ]; int i; - if (strcmp(bstr("sc"), "OK")) { + if (strlen(bstr("ok_button")) == 0) { readloop("readnew"); return; } diff --git a/webcit/webcit.c b/webcit/webcit.c index 61769d691..6050d50ea 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -437,9 +437,8 @@ void http_redirect(char *whichpage) { wprintf("Location: %s\r\n", whichpage); wprintf("URI: %s\r\n", whichpage); wprintf("Content-type: text/html; charset=utf-8\r\n\r\n"); - wprintf("\n"); - wprintf("you really want to be here now\n", - whichpage); + wprintf(""); + wprintf("Go here.", whichpage); wprintf("\n"); } @@ -596,22 +595,10 @@ void output_image() free(xferbuf); } else { - /* Instead of an ugly 404, send a 1x1 transparent GIF * when there's no such image on the server. */ output_static("blank.gif"); - - /* - wprintf("HTTP/1.0 404 %s\n", &buf[4]); - output_headers(0, 0, 0, 0, 0, 0, 0); - wprintf("Content-Type: text/plain\r\n" - "\r\n" - "Error retrieving image: %s\n", - &buf[4] - ); - */ - } @@ -619,6 +606,8 @@ void output_image() } /* + * Generic function to output an arbitrary MIME part from an arbitrary + * message number on the server. */ void output_mimepart() { @@ -644,7 +633,7 @@ void output_mimepart() output_headers(0, 0, 0, 0, 0, 0, 0); wprintf("Content-Type: text/plain\r\n"); wprintf("\r\n"); - wprintf("Error retrieving part: %s\n", &buf[4]); + wprintf(_("An error occurred while retrieving this part: %s\n"), &buf[4]); } } @@ -723,10 +712,9 @@ void url_do_template(void) { void offer_start_page(void) { wprintf("this_page); - wprintf("\">" - "Make this my start page" - "" - ); + wprintf("\">"); + wprintf(_("Make this my start page")); + wprintf(""); } @@ -737,7 +725,7 @@ void change_start_page(void) { if (bstr("startpage") == NULL) { safestrncpy(WC->ImportantMessage, - "startpage set to null", + _("You no longer have a start page selected."), sizeof WC->ImportantMessage); display_main_menu(); return; @@ -766,9 +754,11 @@ void authorization_required(const char *message) wprintf("HTTP/1.0 401 Authorization Required\r\n"); wprintf("WWW-Authenticate: Basic realm=\"\"\r\n", serv_info.serv_humannode); wprintf("Content-Type: text/html\r\n\r\n"); - wprintf("

Authorization Required

\r\n"); - wprintf("The resource you requested requires a valid username and password."); - wprintf("I could not log you in: %s\n", message); + wprintf("

"); + wprintf(_("Authorization Required")); + wprintf("

\r\n"); + wprintf(_("The resource you requested requires a valid username and password. " + "You could not be logged in: %s\n"), message); wDumpContent(0); } @@ -998,11 +988,11 @@ void session_loop(struct httprequest *req) locate_host(browser_host, WC->http_sock); get_serv_info(browser_host, user_agent); if (serv_info.serv_rev_level < MINIMUM_CIT_VERSION) { - wprintf("You are connected to a Citadel " - "server running Citadel %d.%02d;\nin " - "order to run this version of WebCit " + wprintf(_("You are connected to a Citadel " + "server running Citadel %d.%02d. \n" + "In order to run this version of WebCit " "you must also have Citadel %d.%02d or" - " newer.\n\n\n", + " newer.\n\n\n"), serv_info.serv_rev_level / 100, serv_info.serv_rev_level % 100, MINIMUM_CIT_VERSION / 100, @@ -1222,14 +1212,14 @@ void session_loop(struct httprequest *req) } else if (!strcasecmp(action, "editroom")) { editroom(); } else if (!strcasecmp(action, "display_editinfo")) { - display_edit("Room info", "EINF 0", "RINF", "/editinfo", 1); + display_edit(_("Room info"), "EINF 0", "RINF", "/editinfo", 1); } else if (!strcasecmp(action, "editinfo")) { - save_edit("Room info", "EINF 1", 1); + save_edit(_("Room info"), "EINF 1", 1); } else if (!strcasecmp(action, "display_editbio")) { sprintf(buf, "RBIO %s", WC->wc_username); - display_edit("Your bio", "NOOP", buf, "editbio", 3); + display_edit(_("Your bio"), "NOOP", buf, "editbio", 3); } else if (!strcasecmp(action, "editbio")) { - save_edit("Your bio", "EBIO", 0); + save_edit(_("Your bio"), "EBIO", 0); } else if (!strcasecmp(action, "confirm_move_msg")) { confirm_move_msg(); } else if (!strcasecmp(action, "delete_room")) { @@ -1237,13 +1227,13 @@ void session_loop(struct httprequest *req) } else if (!strcasecmp(action, "validate")) { validate(); } else if (!strcasecmp(action, "display_editpic")) { - display_graphics_upload("your photo", + display_graphics_upload(_("your photo"), "UIMG 0|_userpic_", "/editpic"); } else if (!strcasecmp(action, "editpic")) { do_graphics_upload("UIMG 1|_userpic_"); } else if (!strcasecmp(action, "display_editroompic")) { - display_graphics_upload("the icon for this room", + display_graphics_upload(_("the icon for this room"), "UIMG 0|_roompic_", "/editroompic"); } else if (!strcasecmp(action, "editroompic")) { @@ -1257,7 +1247,7 @@ void session_loop(struct httprequest *req) } else if (!strcasecmp(action, "display_editfloorpic")) { sprintf(buf, "UIMG 0|_floorpic_|%s", bstr("which_floor")); - display_graphics_upload("the icon for this floor", + display_graphics_upload(_("the icon for this floor"), buf, "/editfloorpic"); } else if (!strcasecmp(action, "editfloorpic")) { @@ -1363,8 +1353,7 @@ void session_loop(struct httprequest *req) set_preferences(); } else if (!strcasecmp(action, "diagnostics")) { output_headers(1, 1, 1, 0, 0, 0, 0); - - wprintf("You're in session %d
\n", WC->wc_session); + wprintf("Session: %d
\n", WC->wc_session); wprintf("Command:
\n");
 		escputs(cmd);
 		wprintf("

\n"); diff --git a/webcit/webserver.c b/webcit/webserver.c index 1e11f555d..1515ea089 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -451,12 +451,12 @@ int main(int argc, char **argv) } /* Tell 'em who's in da house */ lprintf(1, SERVER "\n"); - lprintf(1, _("Copyright (C) 1996-2005 by the Citadel development team.\n" + lprintf(1, "Copyright (C) 1996-2005 by the Citadel development team.\n" "This software is distributed under the terms of the " - "GNU General Public License.\n\n") + "GNU General Public License.\n\n" ); - lprintf(9, _("Changing directory to %s\n"), webcitdir); + lprintf(9, "Changing directory to %s\n", webcitdir); if (chdir(webcitdir) != 0) { perror("chdir"); } diff --git a/webcit/who.c b/webcit/who.c index 62b84388d..0a8cc1420 100644 --- a/webcit/who.c +++ b/webcit/who.c @@ -22,9 +22,9 @@ void who_inner_div(void) { wprintf("" "\n"); wprintf("\n"); - wprintf("\n"); - wprintf(""); - wprintf("\n\n"); + wprintf("\n", _("User name")); + wprintf("", _("Room")); + wprintf("\n\n", _("From host")); serv_puts("TIME"); serv_getln(buf, sizeof buf); @@ -57,12 +57,10 @@ void who_inner_div(void) { if ((WC->is_aide) && (sess != WC->ctdl_pid)) { wprintf(" [kill]"); + wprintf("\" onClick=\"return ConfirmKill();\">%s", _("(kill)")); } if (sess == WC->ctdl_pid) { - wprintf(" [edit]"); + wprintf(" %s", _("(edit)")); } wprintf(""); @@ -82,13 +80,13 @@ void who_inner_div(void) { wprintf(" " ""); + "alt=\"(idle)\" border=\"0\" />"); } else { wprintf(" " ""); + "alt=\"(active)\" border=\"0\" />"); } wprintf("\n
User NameRoomFrom host
%s%s%s
"); @@ -160,16 +158,15 @@ void who_inner_html(void) { */ void who(void) { - /* - output_headers(1, 1, 2, 0, 1, 0, 0); old refresh30 version - */ + char title[256]; + output_headers(1, 1, 2, 0, 0, 0, 0); wprintf("\n" + "\n", _("Do you really want to kill this session?") ); wprintf("
\n"); @@ -178,8 +175,11 @@ void who(void) "ALIGN=MIDDLE " ">"); /* "onLoad=\"javascript:bodyOnLoad()\" " */ - wprintf(" Users currently on "); - escputs(serv_info.serv_humannode); + wprintf(" "); + + snprintf(title, sizeof title, _("Users currently on %s"), serv_info.serv_humannode); + escputs(title); + wprintf("
"); offer_start_page(); wprintf("
\n"); @@ -191,29 +191,28 @@ void who(void) who_inner_div(); /* Actual data handled by another function */ wprintf("\n"); - wprintf("
" - "Click on a name to read user info. Click on " - "" - " to send an instant message to that user.
\n"); + wprintf("
"); + wprintf(_("Click on a name to read user info. Click on %s " + "to send an instant message to that user."), + "\"(p)\"" + ); + wprintf("
\n"); /* JavaScript to make the ajax refresh happen: * 1. Register the request 'getWholist' which calls the WebCit action 'who_inner_html' * 2. Register the 'fix_scrollbar_bug' div as one we're interested in ajaxifying * 3. setInterval to make the ajax refresh happen every 30 seconds. The random number - * in the request is there to prevent IE from caching the XML even though it's been - * told not to. Die, Microsoft, Die. + * in the request is there to prevent the eternally moronic Internet Explorer from + * caching the XML even though it's been told not to. */ wprintf( -" \n" -" \n" + " \n" ); - wDumpContent(1); } @@ -235,63 +234,72 @@ void edit_me(void) { char buf[SIZ]; - if (!strcasecmp(bstr("sc"), "Change room name")) { + if (strlen(bstr("change_room_name_button")) > 0) { serv_printf("RCHG %s", bstr("fake_roomname")); serv_getln(buf, sizeof buf); http_redirect("/who"); - } else if (!strcasecmp(bstr("sc"), "Change host name")) { + } else if (strlen(bstr("change_host_name_button")) > 0) { serv_printf("HCHG %s", bstr("fake_hostname")); serv_getln(buf, sizeof buf); http_redirect("/who"); - } else if (!strcasecmp(bstr("sc"), "Change user name")) { + } else if (strlen(bstr("change_user_name_button")) > 0) { serv_printf("UCHG %s", bstr("fake_username")); serv_getln(buf, sizeof buf); http_redirect("/who"); - } else if (!strcasecmp(bstr("sc"), "Cancel")) { + } else if (strlen(bstr("cancel_button")) > 0) { http_redirect("/who"); } else { - output_headers(1, 1, 0, 0, 0, 0, 0); wprintf("
\n"); wprintf("
"); wprintf(""); - wprintf("Edit your session display"); + wprintf(_("Edit your session display")); wprintf("
\n"); wprintf("
\n
\n"); - wprintf("This screen allows you to change the way your\n"); - wprintf("session appears in the 'Who is online' listing.\n"); - wprintf("To turn off any 'fake' name you've previously\n"); - wprintf("set, simply click the appropriate 'change' button\n"); - wprintf("without typing anything in the corresponding box.\n"); + wprintf(_("This screen allows you to change the way your " + "session appears in the 'Who is online' listing. " + "To turn off any 'fake' name you've previously " + "set, simply click the appropriate 'change' button " + "without typing anything in the corresponding box. ")); wprintf("
\n"); wprintf("
\n"); wprintf("\n"); - wprintf("\n\n\n\n\n"); - wprintf("\n\n\n"); if (WC->is_aide) { - wprintf("\n\n\n"); } wprintf("
Room name:"); + wprintf("
"); + wprintf(_("Room name:")); + wprintf(""); wprintf("\n"); wprintf(""); - wprintf(""); + wprintf("", + _("Change room name")); wprintf("
Host name:"); + wprintf("
"); + wprintf(_("Host name:")); + wprintf(""); wprintf("\n"); wprintf(""); - wprintf(""); + wprintf("", + _("Change host name")); wprintf("
User name:"); + wprintf("
"); + wprintf(_("User name:")); + wprintf(""); wprintf("\n"); wprintf(""); - wprintf(""); + wprintf("", + _("Change user name")); wprintf("
"); - wprintf(""); + wprintf("", + _("Cancel")); wprintf("
\n"); wprintf("
\n"); wDumpContent(1); -- 2.30.2