]> code.citadel.org Git - citadel.git/blobdiff - webcit/calendar_tools.c
* calendar_tools.c: i18n
[citadel.git] / webcit / calendar_tools.c
index 8113a9474aece591a4b30964b53347fe82036d42..fa8bd902039931aeda48553b51effacdec6324ee 100644 (file)
@@ -4,36 +4,33 @@
  * Miscellaneous functions which handle calendar components.
  */
 
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <limits.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <string.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <pthread.h>
-#include <signal.h>
-#include <time.h>
 #include "webcit.h"
 #include "webserver.h"
 
+/* FIXME ... this needs to be internationalized */
 char *months[] = {
-       "January", "February", "March", "April", "May", "June", "July",
-       "August", "September", "October", "November", "December"
+       "January",
+       "February",
+       "March",
+       "April",
+       "May",
+       "June",
+       "July",
+       "August",
+       "September",
+       "October",
+       "November",
+       "December"
 };
 
 char *days[] = {
-       "Sunday", "Monday", "Tuesday", "Wednesday",
-       "Thursday", "Friday", "Saturday"
+       "Sunday",
+       "Monday",
+       "Tuesday",
+       "Wednesday",
+       "Thursday",
+       "Friday",
+       "Saturday"
 };
 
 char *hourname[] = {
@@ -90,7 +87,7 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
                localtime_r(&tt, &tm);
        }
 
-       wprintf("Month: ");
+       wprintf(_("Month: "));
        wprintf("<SELECT NAME=\"%s_month\" SIZE=\"1\">\n", prefix);
        for (i=0; i<=11; ++i) {
                wprintf("<OPTION %s VALUE=\"%d\">%s</OPTION>\n",
@@ -101,7 +98,7 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
        }
        wprintf("</SELECT>\n");
 
-       wprintf("Day: ");
+       wprintf(_("Day: "));
        wprintf("<SELECT NAME=\"%s_day\" SIZE=\"1\">\n", prefix);
        for (i=1; i<=31; ++i) {
                wprintf("<OPTION %s VALUE=\"%d\">%d</OPTION>\n",
@@ -111,7 +108,7 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
        }
        wprintf("</SELECT>\n");
 
-       wprintf("Year: ");
+       wprintf(_("Year: "));
        wprintf("<SELECT NAME=\"%s_year\" SIZE=\"1\">\n", prefix);
        if ((this_year - t->year) > span) {
                wprintf("<OPTION SELECTED VALUE=\"%d\">%d</OPTION>\n",
@@ -129,7 +126,7 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
        }
        wprintf("</SELECT>\n");
 
-       wprintf("Hour: ");
+       wprintf(_("Hour: "));
        wprintf("<SELECT NAME=\"%s_hour\" SIZE=\"1\">\n", prefix);
        for (i=0; i<=23; ++i) {
 
@@ -149,7 +146,7 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
        }
        wprintf("</SELECT>\n");
 
-       wprintf("Minute: ");
+       wprintf(_("Minute: "));
        wprintf("<SELECT NAME=\"%s_minute\" SIZE=\"1\">\n", prefix);
        for (i=0; i<=59; ++i) {
                if ( (i % 5 == 0) || (tm.tm_min == i) ) {
@@ -204,7 +201,7 @@ void partstat_as_string(char *buf, icalproperty *attendee) {
        icalparameter *partstat_param;
        icalparameter_partstat partstat;
 
-       strcpy(buf, "(status unknown)");
+       strcpy(buf, _("(status unknown)"));
 
        partstat_param = icalproperty_get_first_parameter(
                                attendee,
@@ -220,28 +217,28 @@ void partstat_as_string(char *buf, icalproperty *attendee) {
                        strcpy(buf, "(x)");
                        break;
                case ICAL_PARTSTAT_NEEDSACTION:
-                       strcpy(buf, "(needs action)");
+                       strcpy(buf, _("(needs action)"));
                        break;
                case ICAL_PARTSTAT_ACCEPTED:
-                       strcpy(buf, "(accepted)");
+                       strcpy(buf, _("(accepted)"));
                        break;
                case ICAL_PARTSTAT_DECLINED:
-                       strcpy(buf, "(declined)");
+                       strcpy(buf, _("(declined)"));
                        break;
                case ICAL_PARTSTAT_TENTATIVE:
-                       strcpy(buf, "(tenative)");
+                       strcpy(buf, _("(tenative)"));
                        break;
                case ICAL_PARTSTAT_DELEGATED:
-                       strcpy(buf, "(delegated)");
+                       strcpy(buf, _("(delegated)"));
                        break;
                case ICAL_PARTSTAT_COMPLETED:
-                       strcpy(buf, "(completed)");
+                       strcpy(buf, _("(completed)"));
                        break;
                case ICAL_PARTSTAT_INPROCESS:
-                       strcpy(buf, "(in process)");
+                       strcpy(buf, _("(in process)"));
                        break;
                case ICAL_PARTSTAT_NONE:
-                       strcpy(buf, "(none)");
+                       strcpy(buf, _("(none)"));
                        break;
        }
 }