* vcard_edit.c webcit.c webserver.c who.c : i18n
authorArt Cancro <ajc@citadel.org>
Mon, 22 Aug 2005 21:22:00 +0000 (21:22 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 22 Aug 2005 21:22:00 +0000 (21:22 +0000)
* 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
webcit/vcard_edit.c
webcit/webcit.c
webcit/webserver.c
webcit/who.c

index 0fb2f1afdadda9685e3b2119bb3c1a5eacaffb3a..27588f24ff78bb81251f9e205a869cc01ddd642e 100644 (file)
@@ -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 <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 736eb806f7fa0d3d57a18664cb6d2a8f5b629666..d3d8a8f67942cc40a961536cf68d89065eeee6b3 100644 (file)
@@ -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("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">"
-               "<img src=\"/static/savecontact_48x.gif\">"
-               "Edit contact information"
-               "</SPAN>"
+               "<img src=\"/static/savecontact_48x.gif\">");
+       wprintf(_("Edit contact information"));
+       wprintf("</SPAN>"
                "</TD></TR></TABLE>\n"
                "</div>\n<div id=\"content\">\n"
        );
@@ -182,11 +181,13 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
                "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
 
        wprintf("<TABLE border=0><TR>"
-               "<TD>Prefix</TD>"
-               "<TD>First</TD>"
-               "<TD>Middle</TD>"
-               "<TD>Last</TD>"
-               "<TD>Suffix</TD></TR>\n");
+               "<TD>%s</TD>"
+               "<TD>%s</TD>"
+               "<TD>%s</TD>"
+               "<TD>%s</TD>"
+               "<TD>%s</TD></TR>\n",
+               _("Prefix"), _("First"), _("Middle"), _("Last"), _("Suffix")
+       );
        wprintf("<TR><TD><INPUT TYPE=\"text\" NAME=\"prefix\" "
                "VALUE=\"%s\" MAXLENGTH=\"5\" SIZE=\"5\"></TD>",
                prefix);
@@ -206,13 +207,15 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
        wprintf("<table border=0 width=100%% bgcolor=\"#dddddd\">");
        wprintf("<tr><td>");
 
-       wprintf("Title:<br>"
+       wprintf(_("Title:"));
+       wprintf("<br>"
                "<INPUT TYPE=\"text\" NAME=\"title\" "
                "VALUE=\"%s\" MAXLENGTH=\"40\"><br><br>\n",
                title
        );
 
-       wprintf("Organization:<br>"
+       wprintf(_("Organization:"));
+       wprintf("<br>"
                "<INPUT TYPE=\"text\" NAME=\"org\" "
                "VALUE=\"%s\" MAXLENGTH=\"40\"><br><br>\n",
                org
@@ -221,11 +224,15 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
        wprintf("</td><td>");
 
        wprintf("<table border=0>");
-       wprintf("<tr><td>PO box:</td><td>"
+       wprintf("<tr><td>");
+       wprintf(_("PO box:"));
+       wprintf("</td><td>"
                "<INPUT TYPE=\"text\" NAME=\"pobox\" "
                "VALUE=\"%s\" MAXLENGTH=\"29\"></td></tr>\n",
                pobox);
-       wprintf("<tr><td>Address:</td><td>"
+       wprintf("<tr><td>");
+       wprintf(_("Address:"));
+       wprintf("</td><td>"
                "<INPUT TYPE=\"text\" NAME=\"extadr\" "
                "VALUE=\"%s\" MAXLENGTH=\"29\"></td></tr>\n",
                extadr);
@@ -233,19 +240,27 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
                "<INPUT TYPE=\"text\" NAME=\"street\" "
                "VALUE=\"%s\" MAXLENGTH=\"29\"></td></tr>\n",
                street);
-       wprintf("<tr><td>City:</td><td>"
+       wprintf("<tr><td>");
+       wprintf(_("City:"));
+       wprintf("</td><td>"
                "<INPUT TYPE=\"text\" NAME=\"city\" "
                "VALUE=\"%s\" MAXLENGTH=\"29\"></td></tr>\n",
                city);
-       wprintf("<tr><td>State:</td><td>"
+       wprintf("<tr><td>");
+       wprintf(_("State:"));
+       wprintf("</td><td>"
                "<INPUT TYPE=\"text\" NAME=\"state\" "
                "VALUE=\"%s\" MAXLENGTH=\"2\"></td></tr>\n",
                state);
-       wprintf("<tr><td>ZIP code:</td><td>"
+       wprintf("<tr><td>");
+       wprintf(_("ZIP code:"));
+       wprintf("</td><td>"
                "<INPUT TYPE=\"text\" NAME=\"zipcode\" "
                "VALUE=\"%s\" MAXLENGTH=\"10\"></td></tr>\n",
                zipcode);
-       wprintf("<tr><td>Country:</td><td>"
+       wprintf("<tr><td>");
+       wprintf(_("Country:"));
+       wprintf("</td><td>"
                "<INPUT TYPE=\"text\" NAME=\"country\" "
                "VALUE=\"%s\" MAXLENGTH=\"29\" WIDTH=\"5\"></td></tr>\n",
                country);
@@ -253,11 +268,15 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
 
        wprintf("</table>\n");
 
-       wprintf("<TABLE BORDER=0><TR><TD>Home telephone:</TD>"
+       wprintf("<TABLE BORDER=0><TR><TD>");
+       wprintf(_("Home telephone:"));
+       wprintf("</TD>"
                "<TD><INPUT TYPE=\"text\" NAME=\"hometel\" "
                "VALUE=\"%s\" MAXLENGTH=\"29\"></TD>\n",
                hometel);
-       wprintf("<TD>Work telephone:</TD>"
+       wprintf("<TD>");
+       wprintf(_("Work telephone:"));
+       wprintf("</TD>"
                "<TD><INPUT TYPE=\"text\" NAME=\"worktel\" "
                "VALUE=\"%s\" MAXLENGTH=\"29\"></TD></TR></TABLE>\n",
                worktel);
@@ -266,13 +285,16 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
        wprintf("<tr><td>");
 
        wprintf("<TABLE border=0><TR>"
-               "<TD VALIGN=TOP>Primary Internet e-mail address<br />"
+               "<TD VALIGN=TOP>");
+       wprintf(_("Primary Internet e-mail address"));
+       wprintf("<br />"
                "<INPUT TYPE=\"text\" NAME=\"primary_inetemail\" "
                "SIZE=40 MAXLENGTH=40 VALUE=\"");
        escputs(primary_inetemail);
        wprintf("\"><br />"
-               "</TD><TD VALIGN=TOP>"
-               "Internet e-mail aliases<br />"
+               "</TD><TD VALIGN=TOP>");
+       wprintf(_("Internet e-mail aliases"));
+       wprintf("<br />"
                "<TEXTAREA NAME=\"other_inetemail\" ROWS=5 COLS=40 WIDTH=40>");
        escputs(other_inetemail);
        wprintf("</TEXTAREA></TD></TR></TABLE>\n");
@@ -288,10 +310,12 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
        wprintf("\">\n");
 
        wprintf("<CENTER>\n"
-               "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">"
+               "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
                "&nbsp;"
-               "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">"
-               "</CENTER></FORM>\n"
+               "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
+               "</CENTER></FORM>\n",
+               _("Save changes"),
+               _("Cancel")
        );
        
        wprintf("</td></tr></table></div>\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;
        }
index 61769d691bb7ca1222014beb41ac12947d1ae2a2..6050d50ea097ba14d9fa53a7ed0afbf0d7b9e7f5 100644 (file)
@@ -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("<html><body>\n");
-       wprintf("you really want to be <A HREF=\"%s\">here</A> now\n",
-               whichpage);
+       wprintf("<html><body>");
+       wprintf("Go <A HREF=\"%s\">here</A>.", whichpage);
        wprintf("</body></html>\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("<A HREF=\"/change_start_page?startpage=");
        urlescputs(WC->this_page);
-       wprintf("\">"
-               "<FONT SIZE=-2 COLOR=\"#AAAAAA\">Make this my start page</FONT>"
-               "</A>"
-       );
+       wprintf("\"><FONT SIZE=-2 COLOR=\"#AAAAAA\">");
+       wprintf(_("Make this my start page"));
+       wprintf("</FONT></A>");
 }
 
 
@@ -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("<h1>Authorization Required</h1>\r\n");
-       wprintf("The resource you requested requires a valid username and password.");
-       wprintf("I could not log you in: %s\n", message);
+       wprintf("<h1>");
+       wprintf(_("Authorization Required"));
+       wprintf("</h1>\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<hr />\n", WC->wc_session);
+               wprintf("Session: %d<hr />\n", WC->wc_session);
                wprintf("Command: <br /><PRE>\n");
                escputs(cmd);
                wprintf("</PRE><hr />\n");
index 1e11f555d6c00fd1a26d44e7d7191524fbd9c286..1515ea08939f7691e9faa0db245e6e0ba67ab878 100644 (file)
@@ -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");
        }
index 62b84388db34a02c07981f5dbc796cfbc7a31198..0a8cc142039b71b015dc2f363d830b5026a7019e 100644 (file)
@@ -22,9 +22,9 @@ void who_inner_div(void) {
        wprintf("<table border=\"0\" cellspacing=\"0\" width=\"100%%\" bgcolor=\"#FFFFFF\">"
                "<tr>\n");
        wprintf("<th colspan=\"3\"> </th>\n");
-       wprintf("<th>User Name</th>\n");
-       wprintf("<th>Room</th>");
-       wprintf("<th>From host</th>\n</tr>\n");
+       wprintf("<th>%s</th>\n", _("User name"));
+       wprintf("<th>%s</th>", _("Room"));
+       wprintf("<th>%s</th>\n</tr>\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(" <a href=\"/terminate_session?which_session=%d", sess);
-                               wprintf("\" onClick=\"return ConfirmKill();\" "
-                               ">[kill]</a>");
+                               wprintf("\" onClick=\"return ConfirmKill();\">%s</a>", _("(kill)"));
                        }
                        if (sess == WC->ctdl_pid) {
-                               wprintf(" <a href=\"/edit_me\" "
-                                       ">[edit]</a>");
+                               wprintf(" <a href=\"/edit_me\">%s</a>", _("(edit)"));
                        }
                        wprintf("</td>");
 
@@ -82,13 +80,13 @@ void who_inner_div(void) {
                                wprintf(" "
                                        "<img align=\"middle\" "
                                        "src=\"/static/inactiveuser_24x.gif\" "
-                                       "alt=\"[idle]\" border=\"0\" />");
+                                       "alt=\"(idle)\" border=\"0\" />");
                        }
                        else {
                                wprintf(" "
                                        "<img align=\"middle\" "
                                        "src=\"/static/activeuser_24x.gif\" "
-                                       "alt=\"[active]\" border=\"0\" />");
+                                       "alt=\"(active)\" border=\"0\" />");
                        }
                        wprintf("</td>\n<td>");
 
@@ -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("<script type=\"text/javascript\">\n"
                "function ConfirmKill() { \n"
-               "return confirm('Do you really want to kill this session?');\n"
+               "return confirm('%s');\n"
                "}\n"
-               "</script>\n"
+               "</script>\n", _("Do you really want to kill this session?")
        );
 
        wprintf("<div id=\"banner\">\n");
@@ -178,8 +175,11 @@ void who(void)
                "ALIGN=MIDDLE "
                ">");
                /* "onLoad=\"javascript:bodyOnLoad()\" " */
-       wprintf("<SPAN CLASS=\"titlebar\"> Users currently on ");
-       escputs(serv_info.serv_humannode);
+       wprintf("<SPAN CLASS=\"titlebar\"> ");
+
+       snprintf(title, sizeof title, _("Users currently on %s"), serv_info.serv_humannode);
+       escputs(title);
+
        wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
        offer_start_page();
        wprintf("</TD></TR></TABLE>\n");
@@ -191,29 +191,28 @@ void who(void)
        who_inner_div();        /* Actual data handled by another function */
        wprintf("</div>\n");
 
-       wprintf("<div id=\"instructions\" align=center>"
-               "Click on a name to read user info.  Click on "
-               "<IMG ALIGN=MIDDLE SRC=\"/static/citadelchat_16x.gif\" "
-               "ALT=\"(p)\" BORDER=0>"
-               " to send an instant message to that user.</div>\n");
+       wprintf("<div id=\"instructions\" align=center>");
+       wprintf(_("Click on a name to read user info.  Click on %s "
+               "to send an instant message to that user."),
+               "<img align=\"middle\" src=\"/static/citadelchat_16x.gif\" alt=\"(p)\" border=\"0\">"
+       );
+       wprintf("</div>\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"
-" <script type=\"text/javascript\">                                    \n"
-"      ajaxEngine.registerRequest('getWholist', 'who_inner_html');\n"
-"      ajaxEngine.registerAjaxElement('fix_scrollbar_bug');    \n"
-"      setInterval(\"ajaxEngine.sendRequest('getWholist', 'junk='+Math.random());\", 30000);   \n"
-"</script>\n"
+               "<script type=\"text/javascript\">                                                              \n"
+               "       ajaxEngine.registerRequest('getWholist', 'who_inner_html');                             \n"
+               "       ajaxEngine.registerAjaxElement('fix_scrollbar_bug');                                    \n"
+               "       setInterval(\"ajaxEngine.sendRequest('getWholist', 'junk='+Math.random());\", 30000);   \n"
+               "</script>                                                                                      \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("<div id=\"banner\">\n");
                wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
                wprintf("<SPAN CLASS=\"titlebar\">");
-               wprintf("Edit your session display");
+               wprintf(_("Edit your session display"));
                wprintf("</SPAN></TD></TR></TABLE>\n");
                wprintf("</div>\n<div id=\"content\">\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("<br />\n");
 
                wprintf("<FORM METHOD=\"POST\" ACTION=\"/edit_me\">\n");
 
                wprintf("<TABLE border=0 width=100%%>\n");
 
-               wprintf("<TR><TD><B>Room name:</B></TD>\n<TD>");
+               wprintf("<TR><TD><B>");
+               wprintf(_("Room name:"));
+               wprintf("</B></TD>\n<TD>");
                wprintf("<INPUT TYPE=\"text\" NAME=\"fake_roomname\" MAXLENGTH=\"64\">\n");
                wprintf("</TD>\n<TD ALIGN=center>");
-               wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change room name\">");
+               wprintf("<INPUT TYPE=\"submit\" NAME=\"change_room_name_button\" VALUE=\"%s\">",
+                       _("Change room name"));
                wprintf("</TD>\n</TR>\n");
 
-               wprintf("<TR><TD><B>Host name:</B></TD><TD>");
+               wprintf("<TR><TD><B>");
+               wprintf(_("Host name:"));
+               wprintf("</B></TD><TD>");
                wprintf("<INPUT TYPE=\"text\" NAME=\"fake_hostname\" MAXLENGTH=\"64\">\n");
                wprintf("</TD>\n<TD ALIGN=center>");
-               wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change host name\">");
+               wprintf("<INPUT TYPE=\"submit\" NAME=\"change_host_name_button\" VALUE=\"%s\">",
+                       _("Change host name"));
                wprintf("</TD>\n</TR>\n");
 
                if (WC->is_aide) {
-                       wprintf("<TR><TD><B>User name:</B></TD><TD>");
+                       wprintf("<TR><TD><B>");
+                       wprintf(_("User name:"));
+                       wprintf("</B></TD><TD>");
                        wprintf("<INPUT TYPE=\"text\" NAME=\"fake_username\" MAXLENGTH=\"64\">\n");
                        wprintf("</TD>\n<TD ALIGN=center>");
-                       wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change user name\">");
+                       wprintf("<INPUT TYPE=\"submit\" NAME=\"change_user_name_button\" VALUE=\"%s\">",
+                               _("Change user name"));
                        wprintf("</TD>\n</TR>\n");
                }
                wprintf("<TR><TD> </TD><TD> </TD><TD ALIGN=center>");
-               wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
+               wprintf("<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">",
+                       _("Cancel"));
                wprintf("</TD></TR></TABLE>\n");
                wprintf("</FORM></CENTER>\n");
                wDumpContent(1);