From: Art Cancro Date: Mon, 22 Aug 2005 19:26:09 +0000 (+0000) Subject: * subst.c summary.c sysmsgs.c : i18n X-Git-Tag: v7.86~4695 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=f7c7f356784c08b353785ac0b66d2ac3bd1ed251;p=citadel.git * subst.c summary.c sysmsgs.c : i18n --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 4ecea5ace..d67cda898 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -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 1998-12-03 Nathan Bryant * webserver.c: warning fix - diff --git a/webcit/subst.c b/webcit/subst.c index 562ae254e..ac73e327f 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -202,7 +202,7 @@ void do_template(void *templatename) { fp = fopen(filename, "r"); if (fp == NULL) { - wprintf("ERROR - could not open template "); + wprintf(_("ERROR: could not open template ")); wprintf("'%s' - %s
\n", templatename, strerror(errno)); return; diff --git a/webcit/summary.c b/webcit/summary.c index ed5bb61e8..1c7848611 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -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 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 online now"); + svprintf("BOXTITLE", WCS_STRING, _("Who's online 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("(None)
\n"); + wprintf(""); + wprintf(_("(None)")); + wprintf("
\n"); } else { for (i=0; i(This server does not support task lists)\n"); + wprintf(""); + wprintf(_("(This server does not support task lists)")); + wprintf("\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 on your calendar"); + svprintf("BOXTITLE", WCS_STRING, _("Today on your calendar")); do_template("beginbox"); #ifdef WEBCIT_WITH_CALENDAR_SERVICE gotoroom("_CALENDAR_"); @@ -166,7 +185,9 @@ void calendar_section(void) { } if (num_msgs < 1) { - wprintf("(Nothing)
\n"); + wprintf(""); + wprintf(_("(Nothing)")); + wprintf("
\n"); } else { for (i=0; i(This server does not support calendars)\n"); + wprintf(""); + wprintf(_("(This server does not support calendars)")); + wprintf("\n"); #endif /* WEBCIT_WITH_CALENDAR_SERVICE */ do_template("endbox"); } - /* * Server info section (fluff, really) */ void server_info_section(void) { - svprintf("BOXTITLE", WCS_STRING, "About this server"); + char message[512]; + + svprintf("BOXTITLE", WCS_STRING, _("About this 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(".
\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("
\n"); wprintf("" "
" "" - "Summary page for "); - escputs(WC->wc_username); + ); + + snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_username); + escputs(title); wprintf("\n"); wprintf(""); output_date(); diff --git a/webcit/sysmsgs.c b/webcit/sysmsgs.c index b2ba73f89..d377a899a 100644 --- a/webcit/sysmsgs.c +++ b/webcit/sysmsgs.c @@ -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("
Enter %s below. Text is formatted to\n", description); - wprintf("the reader's screen width. To defeat the\n"); - wprintf("formatting, indent a line at least one space. \n"); + wprintf("
"); + 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("
"); wprintf("
\n", save_cmd); @@ -46,11 +47,11 @@ void display_edit(char *description, char *check_cmd, if (buf[0] == '1') server_to_text(); wprintf("

\n"); - wprintf(""); + wprintf("", _("Save changes")); wprintf(" "); - wprintf("
\n"); + wprintf("
\n", _("Cancel")); - wprintf("
\n"); + wprintf("\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; }