From: Art Cancro Date: Sat, 20 Aug 2005 04:37:50 +0000 (+0000) Subject: * mainmenu.c: i18n X-Git-Tag: v7.86~4704 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=4c0bb762a1662df4c00de1d6a931d21a20d1de14;p=citadel.git * mainmenu.c: i18n * messages.c: partially i18n --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 54961b99b..4a1486a79 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 621.19 2005/08/20 04:37:50 ajc +* mainmenu.c: i18n +* messages.c: partially i18n + Revision 621.18 2005/08/19 21:46:48 ajc * inetconf.c, listsub.c, part of mainmenu.c: i18n @@ -2856,3 +2860,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index 568e44e61..8afd567d0 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -293,9 +293,9 @@ void display_generic(void) wprintf(""); wprintf(_("Detected host header is %s://%s"), (is_https ? "https" : "http"), WC->http_host); wprintf("\n"); - wprintf(""); + wprintf("", _("Send command")); wprintf(" "); - wprintf("
\n"); + wprintf("
\n", _("Cancel")); wprintf("\n"); wprintf("\n"); @@ -309,7 +309,7 @@ void do_generic(void) char *junk; size_t len; - if (strcasecmp(bstr("sc"), "Send command")) { + if (strlen(bstr("sc_button")) == 0) { display_main_menu(); return; } diff --git a/webcit/messages.c b/webcit/messages.c index 98f9b388f..c0bd46cd0 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -338,11 +338,11 @@ void display_parsed_vcard(struct vCard *v, int full) { if (!strcasecmp(buf, "tel")) strcat(phone, ""); else if (!strcasecmp(buf, "work")) - strcat(phone, " (work)"); + strcat(phone, _(" (work)")); else if (!strcasecmp(buf, "home")) - strcat(phone, " (home)"); + strcat(phone, _(" (home)")); else if (!strcasecmp(buf, "cell")) - strcat(phone, " (cell)"); + strcat(phone, _(" (cell)")); else { strcat(phone, " ("); strcat(phone, buf); @@ -352,7 +352,9 @@ void display_parsed_vcard(struct vCard *v, int full) { } else if (!strcasecmp(firsttoken, "adr")) { if (pass == 2) { - wprintf("Address:"); + wprintf(""); + wprintf(_("Address:")); + wprintf(""); for (j=0; j 0) { @@ -410,9 +412,13 @@ void display_parsed_vcard(struct vCard *v, int full) { wprintf("\n"); if (strlen(phone) > 0) - wprintf("Telephone:%s\n", phone); + wprintf(""); + wprintf(_("Telephone:")); + wprintf("%s\n", phone); if (strlen(mailto) > 0) - wprintf("E-mail:%s\n", mailto); + wprintf(""); + wprintf(_("E-mail:")); + wprintf("%s\n", mailto); } } @@ -507,7 +513,9 @@ void read_message(long msgnum, int suppress_buttons) { serv_printf("MSG4 %ld", msgnum); serv_getln(buf, sizeof buf); if (buf[0] != '1') { - wprintf("ERROR: %s
\n", &buf[4]); + wprintf(""); + wprintf(_("ERROR:")); + wprintf(" %s
\n", &buf[4]); return; } @@ -525,7 +533,9 @@ void read_message(long msgnum, int suppress_buttons) { while (serv_getln(buf, sizeof buf), strcasecmp(buf, "text")) { if (!strcmp(buf, "000")) { - wprintf("unexpected end of message

\n"); + wprintf(""); + wprintf(_("unexpected end of message")); + wprintf("

\n"); wprintf("\n"); return; } @@ -537,7 +547,8 @@ void read_message(long msgnum, int suppress_buttons) { format_type = atoi(&buf[5]); if (!strncasecmp(buf, "from=", 5)) { strcpy(from, &buf[5]); - wprintf("from "); } - if (!strncasecmp(buf, "subj=", 5)) + if (!strncasecmp(buf, "subj=", 5)) { strcpy(m_subject, &buf[5]); + } if ((!strncasecmp(buf, "hnod=", 5)) - && (strcasecmp(&buf[5], serv_info.serv_humannode))) + && (strcasecmp(&buf[5], serv_info.serv_humannode))) { wprintf("(%s) ", &buf[5]); + } if ((!strncasecmp(buf, "room=", 5)) && (strcasecmp(&buf[5], WC->wc_roomname)) - && (strlen(&buf[5])>0) ) - wprintf("in %s> ", &buf[5]); + && (strlen(&buf[5])>0) ) { + wprintf(_("in ")); + wprintf("%s> ", &buf[5]); + } if (!strncasecmp(buf, "rfca=", 5)) { strcpy(rfca, &buf[5]); wprintf("<"); @@ -572,8 +587,10 @@ void read_message(long msgnum, int suppress_buttons) { wprintf("@%s ", &buf[5]); } } - if (!strncasecmp(buf, "rcpt=", 5)) - wprintf("to %s ", &buf[5]); + if (!strncasecmp(buf, "rcpt=", 5)) { + wprintf(_("to ")); + wprintf("%s ", &buf[5]); + } if (!strncasecmp(buf, "time=", 5)) { fmt_date(now, atol(&buf[5]), 0); wprintf("%s ", now); @@ -651,9 +668,9 @@ void read_message(long msgnum, int suppress_buttons) { #endif if (strlen(m_subject) > 0) { wprintf("
" - "" - "Subject: %s" - "", m_subject + ""); + wprintf(_("Subject:")); + wprintf(" %s", m_subject ); } wprintf("\n"); @@ -668,23 +685,22 @@ void read_message(long msgnum, int suppress_buttons) { wprintf("?subject="); if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20"); urlescputs(m_subject); - wprintf("\">[Reply]
"); + wprintf("\">[%s] ", _("Reply")); if (WC->is_room_aide) { - /* Move */ - wprintf("[Move] ", - msgnum); + wprintf("[%s] ", + msgnum, _("Move")); /* Delete */ wprintf("" - "[Delete] ", msgnum); - + "onClick=\"return confirm('%s');\">" + "[%s] ", msgnum, _("Delete this message?"), _("Delete") + ); } wprintf("" - "[Print]", msgnum); + "[%s]", msgnum, _("Print")); wprintf(""); } @@ -701,7 +717,9 @@ void read_message(long msgnum, int suppress_buttons) { strcpy(mime_content_type, "text/plain"); while (serv_getln(buf, sizeof buf), (strlen(buf) > 0)) { if (!strcmp(buf, "000")) { - wprintf("unexpected end of message

\n"); + wprintf(""); + wprintf(_("unexpected end of message")); + wprintf("

\n"); goto ENDBODY; } if (!strncasecmp(buf, "Content-type: ", 14)) { @@ -783,8 +801,8 @@ void read_message(long msgnum, int suppress_buttons) { /* Unknown weirdness */ else { - wprintf("I don't know how to display %s
\n", - mime_content_type); + wprintf(_("I don't know how to display %s"), mime_content_type); + wprintf("
\n", mime_content_type); while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { } } @@ -806,7 +824,7 @@ void read_message(long msgnum, int suppress_buttons) { wprintf("", msgnum, vcard_partnum); - wprintf("[edit]"); + wprintf("[%s]", _("edit")); } /* In all cases, display the full card */ @@ -938,7 +956,7 @@ void display_addressbook(long msgnum, char alpha) { struct message_summary summ; memset(&summ, 0, sizeof(summ)); - safestrncpy(summ.subj, "(no subject)", sizeof summ.subj); + safestrncpy(summ.subj, _("(no subject)"), sizeof summ.subj); sprintf(buf, "MSG0 %ld|1", msgnum); /* ask for headers only */ serv_puts(buf); @@ -975,7 +993,7 @@ void display_addressbook(long msgnum, char alpha) { wprintf("", msgnum, vcard_partnum); - wprintf("[edit]"); + wprintf("[%s]", _("edit")); } free(vcard_source); @@ -1061,7 +1079,7 @@ void fetch_ab_name(long msgnum, char *namebuf) { for (i=0; iThis address book is empty.\n"); + wprintf(""); + wprintf(_("This address book is empty.")); + wprintf("\n"); return; } @@ -1231,7 +1251,7 @@ int load_msg_ptrs(char *servcmd, int with_headers) memset(&WC->summ[nummsgs-1], 0, sizeof(struct message_summary)); WC->summ[nummsgs-1].msgnum = WC->msgarr[nummsgs-1]; - safestrncpy(WC->summ[nummsgs-1].subj, "(no subject)", sizeof WC->summ[nummsgs-1].subj); + safestrncpy(WC->summ[nummsgs-1].subj, _("(no subject)"), sizeof WC->summ[nummsgs-1].subj); if (strlen(displayname) > 0) { safestrncpy(WC->summ[nummsgs-1].from, displayname, sizeof WC->summ[nummsgs-1].from); } @@ -1451,13 +1471,15 @@ void readloop(char *oper) if (nummsgs == 0) { if ((!is_tasks) && (!is_calendar) && (!is_notes)) { + wprintf(""); if (!strcmp(oper, "readnew")) { - wprintf("No new messages.\n"); + wprintf(_("No new messages.")); } else if (!strcmp(oper, "readold")) { - wprintf("No old messages.\n"); + wprintf(_("No old messages.")); } else { - wprintf("No messages here.\n"); + wprintf(_("No messages here.")); } + wprintf("\n"); } goto DONE; @@ -1556,18 +1578,18 @@ void readloop(char *oper) "\n" "" - "" - "" - "" + "" + "" + "" "" "\n" , - subjsort_button, - sendsort_button, - datesort_button + _("Subject"), subjsort_button, + _("Sender"), sendsort_button, + _("Date"), datesort_button ); } @@ -1645,19 +1667,19 @@ void readloop(char *oper) if ((!is_tasks) && (!is_calendar) && (!is_addressbook) && (!is_notes) && (!is_singlecard)) { wprintf("
" - "
Subject %sSender %sDate %s%s %s%s %s%s %s
\n" - "
" - "Reading #%d of %d messages.", - lowest_displayed, nummsgs); + "
"); + wprintf(_("Reading #%d of %d messages."), lowest_displayed, nummsgs); + wprintf(""); if (pn_previous > 0L) { wprintf("" - "Previous \n", + "%s \n", oper, - pn_previous ); + pn_previous, + _("Previous")); } if (pn_next > 0L) { @@ -1665,18 +1687,20 @@ void readloop(char *oper) "?startmsg=%ld" "?maxmsgs=1" "?summary=0\">" - "Next \n", + "%s \n", oper, - pn_next ); + pn_next, + _("Next")); } wprintf("" - "Summary" + "%s" "", oper, WC->msgarr[0], - DEFAULT_MAXMSGS + DEFAULT_MAXMSGS, + _("Summary") ); wprintf("
\n"); @@ -1694,7 +1718,7 @@ void readloop(char *oper) wprintf("
\n"); - wprintf("Reading #", lowest_displayed, highest_displayed); + wprintf(_("Reading #"), lowest_displayed, highest_displayed); wprintf(" of %d messages.", nummsgs); + wprintf(" "); + wprintf(_("of %d messages."), nummsgs); wprintf("
\n"); } } @@ -2159,9 +2184,9 @@ void confirm_move_msg(void) wprintf("\n"); wprintf("
\n"); - wprintf(""); + wprintf(""); wprintf(" "); - wprintf(""); + wprintf(""); wprintf("\n"); wprintf("\n"); @@ -2179,7 +2204,7 @@ void move_msg(void) output_headers(1, 1, 1, 0, 0, 0, 0); - if (!strcasecmp(bstr("yesno"), "Move")) { + if (strlen(bstr("move_button")) > 0) { sprintf(buf, "MOVE %ld|%s", msgid, bstr("target_room")); serv_puts(buf); serv_getln(buf, sizeof buf);