* subst.c summary.c sysmsgs.c : i18n
authorArt Cancro <ajc@citadel.org>
Mon, 22 Aug 2005 19:26:09 +0000 (19:26 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 22 Aug 2005 19:26:09 +0000 (19:26 +0000)
webcit/ChangeLog
webcit/subst.c
webcit/summary.c
webcit/sysmsgs.c

index 4ecea5acef9762840827b61d987a2fbc08f6365f..d67cda89825bbe4023b2fbdb8d4f685f124f12ca 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 621.26  2005/08/22 19:26:09  ajc
+* subst.c summary.c sysmsgs.c : i18n
+
 Revision 621.25  2005/08/22 19:06:52  ajc
 * siteconfig.c: i18n
 
@@ -2883,4 +2886,3 @@ 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 562ae254e1badbeb533be6742e7ee4d0ada0f7e2..ac73e327ff3c2d2ee19ba6b476f4eb3276592ccd 100644 (file)
@@ -202,7 +202,7 @@ void do_template(void *templatename) {
        
        fp = fopen(filename, "r");
        if (fp == NULL) {
-               wprintf("<BLINK>ERROR</BLINK> - could not open template ");
+               wprintf(_("ERROR: could not open template "));
                wprintf("'%s' - %s<br />\n",
                        templatename, strerror(errno));
                return;
index ed5bb61e81b7aacb3fe4f6a055c08a8cb59bb01f..1c784861192130e41af52ed0024aa99d4c1c8d85 100644 (file)
@@ -13,14 +13,29 @@ void output_date(void) {
        struct tm tm;
        time_t now;
 
-       static char *wdays[] = {
-               "Sunday", "Monday", "Tuesday", "Wednesday",
-               "Thursday", "Friday", "Saturday"
-       };
-       static char *months[] = {
-               "January", "February", "March", "April", "May", "June", "July",
-               "August", "September", "October", "November", "December"
-       };
+       static char *wdays[7];
+       static char *months[12];
+
+       wdays[0] = _("Sunday");
+       wdays[1] = _("Monday");
+       wdays[2] = _("Tuesday");
+       wdays[3] = _("Wednesday");
+       wdays[4] = _("Thursday");
+       wdays[5] = _("Friday");
+       wdays[6] = _("Saturday");
+
+       months[0] = _("January");
+       months[1] = _("February");
+       months[2] = _("March");
+       months[3] = _("April");
+       months[4] = _("May");
+       months[5] = _("June");
+       months[6] = _("July");
+       months[7] = _("August");
+       months[8] = _("September");
+       months[9] = _("October");
+       months[10] = _("November");
+       months[12] = _("December");
 
        time(&now);
        localtime_r(&now, &tm);
@@ -42,7 +57,7 @@ void output_date(void) {
 void dummy_section(void) {
        svprintf("BOXTITLE", WCS_STRING, "(dummy&nbsp;section)");
        do_template("beginbox");
-       wprintf("(nothing)");
+       wprintf(_("(nothing)"));
        do_template("endbox");
 }
 
@@ -57,7 +72,7 @@ void new_messages_section(void) {
        int number_of_rooms_to_check;
        char *rooms_to_check = "Mail|Lobby";
 
-       svprintf("BOXTITLE", WCS_STRING, "Messages");
+       svprintf("BOXTITLE", WCS_STRING, _("Messages"));
        do_template("beginbox");
 
        number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
@@ -94,7 +109,7 @@ void wholist_section(void) {
        char buf[SIZ];
        char user[SIZ];
 
-       svprintf("BOXTITLE", WCS_STRING, "Who's&nbsp;online&nbsp;now");
+       svprintf("BOXTITLE", WCS_STRING, _("Who's&nbsp;online&nbsp;now"));
        do_template("beginbox");
        serv_puts("RWHO");
        serv_getln(buf, sizeof buf);
@@ -116,7 +131,7 @@ void tasks_section(void) {
        int i;
 #endif
 
-       svprintf("BOXTITLE", WCS_STRING, "Tasks");
+       svprintf("BOXTITLE", WCS_STRING, _("Tasks"));
        do_template("beginbox");
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
        gotoroom("_TASKS_");
@@ -128,7 +143,9 @@ void tasks_section(void) {
        }
 
        if (num_msgs < 1) {
-               wprintf("<i>(None)</i><br />\n");
+               wprintf("<i>");
+               wprintf(_("(None)"));
+               wprintf("</i><br />\n");
        }
        else {
                for (i=0; i<num_msgs; ++i) {
@@ -139,7 +156,9 @@ void tasks_section(void) {
        calendar_summary_view();
 
 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
-       wprintf("<I>(This server does not support task lists)</I>\n");
+       wprintf("<I>");
+       wprintf(_("(This server does not support task lists)"));
+       wprintf("</I>\n");
 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
        do_template("endbox");
 }
@@ -154,7 +173,7 @@ void calendar_section(void) {
        int i;
 #endif
 
-       svprintf("BOXTITLE", WCS_STRING, "Today&nbsp;on&nbsp;your&nbsp;calendar");
+       svprintf("BOXTITLE", WCS_STRING, _("Today&nbsp;on&nbsp;your&nbsp;calendar"));
        do_template("beginbox");
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
        gotoroom("_CALENDAR_");
@@ -166,7 +185,9 @@ void calendar_section(void) {
        }
 
        if (num_msgs < 1) {
-               wprintf("<i>(Nothing)</i><br />\n");
+               wprintf("<i>");
+               wprintf(_("(Nothing)"));
+               wprintf("</i><br />\n");
        }
        else {
                for (i=0; i<num_msgs; ++i) {
@@ -176,29 +197,30 @@ void calendar_section(void) {
        }
 
 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
-       wprintf("<I>(This server does not support calendars)</I>\n");
+       wprintf("<I>");
+       wprintf(_("(This server does not support calendars)"));
+       wprintf("</I>\n");
 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
        do_template("endbox");
 }
 
-
 /*
  * Server info section (fluff, really)
  */
 void server_info_section(void) {
-       svprintf("BOXTITLE", WCS_STRING, "About&nbsp;this&nbsp;server");
+       char message[512];
+
+       svprintf("BOXTITLE", WCS_STRING, _("About&nbsp;this&nbsp;server"));
        do_template("beginbox");
-       wprintf("You are connected to ");
-       escputs(serv_info.serv_humannode);
-       wprintf(", running ");
-       escputs(serv_info.serv_software);
-       wprintf(" with ");
-       escputs(SERVER);
-       wprintf(", and located in ");
-       escputs(serv_info.serv_bbs_city);
-       wprintf(".<br />\nYour system administrator is ");
-       escputs(serv_info.serv_sysadm);
-       wprintf(".\n");
+
+       snprintf(message, sizeof message,
+               _("You are connected to %s, running %s with %s, and located in %s.  Your system administrator is %s."),
+               serv_info.serv_humannode,
+               serv_info.serv_software,
+               SERVER,
+               serv_info.serv_bbs_city,
+               serv_info.serv_sysadm);
+       escputs(message);
        do_template("endbox");
 }
 
@@ -207,14 +229,17 @@ void server_info_section(void) {
  * Display this user's summary page
  */
 void summary(void) {
+       char title[256];
 
        output_headers(1, 1, 2, 0, 1, 0, 0);
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=#444455><TR>"
                "<TD><IMG SRC=\"/static/summscreen_48x.gif\"></TD><TD>"
                "<SPAN CLASS=\"titlebar\">"
-               "Summary page for ");
-       escputs(WC->wc_username);
+       );
+
+       snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_username);
+       escputs(title);
        wprintf("</SPAN></TD><TD>\n");
        wprintf("</TD><TD ALIGN=RIGHT><SPAN CLASS=\"titlebar\">");
        output_date();
index b2ba73f898b51cad5b537e0a871a16976ed5f235..d377a899a466630165161268e6a6439c3866c1db 100644 (file)
@@ -30,12 +30,13 @@ void display_edit(char *description, char *check_cmd,
                output_headers(1, 1, 0, 0, 0, 0, 0);
        }
 
-       svprintf("BOXTITLE", WCS_STRING, "Edit %s", description);
+       svprintf("BOXTITLE", WCS_STRING, _("Edit %s"), description);
        do_template("beginbox");
 
-       wprintf("<CENTER>Enter %s below.  Text is formatted to\n", description);
-       wprintf("the <EM>reader's</EM> screen width.  To defeat the\n");
-       wprintf("formatting, indent a line at least one space.  \n");
+       wprintf("<div align=\"center\">");
+       wprintf(_("Enter %s below.  Text is formatted to "
+               "the reader's screen width.  To defeat the "
+               "formatting, indent a line at least one space."), description);
        wprintf("<br />");
 
        wprintf("<FORM METHOD=\"POST\" ACTION=\"%s\">\n", save_cmd);
@@ -46,11 +47,11 @@ void display_edit(char *description, char *check_cmd,
        if (buf[0] == '1')
                server_to_text();
        wprintf("</TEXTAREA><br /><br />\n");
-       wprintf("<INPUT TYPE=\"submit\" NAME=\"save_button\" VALUE=\"Save\">");
+       wprintf("<INPUT TYPE=\"submit\" NAME=\"save_button\" VALUE=\"%s\">", _("Save changes"));
        wprintf("&nbsp;");
-       wprintf("<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"Cancel\"><br />\n");
+       wprintf("<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\"><br />\n", _("Cancel"));
 
-       wprintf("</FORM></CENTER>\n");
+       wprintf("</FORM></div>\n");
        do_template("endbox");
        wDumpContent(1);
 }
@@ -65,7 +66,8 @@ void save_edit(char *description, char *enter_cmd, int regoto)
 
        if (strlen(bstr("save_button")) == 0) {
                sprintf(WC->ImportantMessage,
-                       "Cancelled.  %s was not saved.\n", description);
+                       _("Cancelled.  %s was not saved."),
+                       description);
                display_main_menu();
                return;
        }
@@ -83,7 +85,8 @@ void save_edit(char *description, char *enter_cmd, int regoto)
                smart_goto(WC->wc_roomname);
        } else {
                sprintf(WC->ImportantMessage,
-                       "%s has been saved.\n", description);
+                       _("%s has been saved."),
+                       description);
                display_main_menu();
                return;
        }