DtMail translations and improvements of vcal2xampia.awk
authorEdmond ORIGNAC <Edmond.Orignac@wanadoo.fr>
Mon, 2 Jan 2017 18:52:41 +0000 (19:52 +0100)
committerJon Trulson <jon@radscan.com>
Tue, 3 Jan 2017 20:23:23 +0000 (13:23 -0700)
dtmail: messages of the 'Mail Retrieval' menu of dtmail  were left untranslated.
French, Italian, Spanish translations were added.
vcal2xapia.awk: capacity to handle UTC+n timezones and TODO items added.

cde/contrib/vcal2xapia/README
cde/contrib/vcal2xapia/vcal2xapia.awk
cde/programs/localized/es_ES.ISO8859-1/msg/DtMail.msg
cde/programs/localized/es_ES.ISO8859-1/msg/dtmailopts.msg
cde/programs/localized/fr_FR.ISO8859-1/msg/DtMail.msg
cde/programs/localized/fr_FR.ISO8859-1/msg/dtcalc.msg
cde/programs/localized/fr_FR.ISO8859-1/msg/dtinfo_start.msg
cde/programs/localized/fr_FR.ISO8859-1/msg/dtmailopts.msg
cde/programs/localized/fr_FR.ISO8859-1/msg/dttypes.msg
cde/programs/localized/it_IT.ISO8859-1/msg/DtMail.msg
cde/programs/localized/it_IT.ISO8859-1/msg/dtmailopts.msg

index 638ffba7d088354637f98e85a4ecfd79dc9edcf6..dcf02cbc9535bd8bd0037eedcafb1bc05fd2f9bd 100644 (file)
@@ -1,8 +1,8 @@
-Hello,
+The AWK script converts .vcs files into XAPIA format files that can then
+be dragged and dropped on the Calendar icon of the front panel to
+insert an appointment in the CDE calendar.
 
-I have written a simple AWK program to convert .vcs files into
-XAPIA format files that can then be dragged and dropped on the Calendar
-icon of the front panel to insert an appointment in the CDE calendar.
+Initial version:
 
 The program has some limitations. For the moment, it ignores ToDo items
 and only converts appointment items. Also, it has to convert 
@@ -13,34 +13,31 @@ This is done by using an average duration of 30.44 days for a month
 and 365.25 days for a year instead of using the correct duration for
 leap years and for months. So the duration of an appointment can
 be sometimes calculated incorrectly.
+Appointments in the local time are not handled very well. The script
+assumes that the local time is UTC+1.
 
-If you wish to include it with the CDE sources or to post it on the Wiki 
-documentation, I agree to release it under MIT license.
+It is released under MIT license.
       http://opensource.org/licenses/MIT
 
-Otherwise, there are better programs in Perl by Adam Stein at:
+Better programs (in Perl) to interact with dtcm by Adam Stein are available at:
 http://www.csh.rit.edu/~adam/Progs/programs.html
-but they require to install some extra Perl libraries.
+They require to install the Calendar-CSA-0.8.tar.gz Perl libraries from CPAN.
 
 
-I would like to mention that Christian Pélissier (author of a popular
-textbook on Unix in French) has posted a dtksh program in a french
+Christian Pélissier  has posted a dtksh program in a french
 email list on Solaris x86 that also does the vcal to XAPIA
 conversion. His message is archived here:
 http://www.mail-archive.com/solaris_fr@x86.sun.com/msg02388.html
 
-Please add in the comments at the top of my AWK program the links to
-his dtksh program and to Adam Stein's Perl programs:
-http://www.csh.rit.edu/~adam/Progs/programs.html
-
 Version 2.2.4:
 
 - improvements to the script to handle repeating appointments.
-
+  The script supports appointments that repeat every N week/month/days.
 - easter.awk: script that creates appointments for (Roman Catholic)
-  Easter, Ascencion Day and Whit Sunday.
+  Easter, Ascension Day and Whit Sunday.
 
-Best wishes,
+Current version:
 
-Edmond Orignac
+- added support for ToDo items.
+- added support for numeric timezones (TZ:+NN or TZ:-NN).
 
index 1f848dafda03572ab334e48a774be5384c0c16e7..cc93d9f948159a471e61176891cb9e595b4de9c8 100644 (file)
@@ -6,12 +6,16 @@
 BEGIN {FS=":"} 
 
 
-/^BEGIN/ {if ($2~"VEVENT") {appnt=1; rxtype=0; nxr=0; mxday=0; mxmonth=0; runtil=0; xinterval=0}
-} 
-/^TZ/ {if ($2~"[+-][1-9]*") {timezone=$2} else {timezone=0}}
+/^BEGIN/ {if ($2~"VEVENT") {appnt=1; rxtype=0; nxr=0; mxday=0; mxmonth=0; runtil=0; xinterval=0} else if ($2~"VTODO") {appnt=2 ; rxtype=0; nxr=0; mxday=0; mxmonth=0; runtil=0;xinterval=0}}
+/^TZ/ {if ($2~"[+-][1-9]*") {timezone=$2} else {timezone=1}}
 # Knowing the timezone, we can convert local time to UTC time. 
+# Unfortunately, it is only working if the timezone is indicated by
+# a number as in "TZ:+03" not in the case of TZ=Europe/Paris.
+# If we fail to get a numeric value, we assume the timezone is UTC+1
 /^DTSTART/ {sdate=$2}
-/^DTEND/ {fdate=$2} 
+/^DTEND/ {fdate=$2}
+/^DUE/ {ddate=$2; tsksts=2304}
+/^COMPLETED/ {ddate=$2;tsksts=6}
 /^DESCRIPTION/ {summary=summary" "substr($0,13)}
 /^SUMMARY/ {summary=summary" "substr($0,9)}
 /^LOCATION/ {summary=summary" in "substr($0,10)} 
@@ -152,14 +156,14 @@ BEGIN {FS=":"}
        printf("-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Repeat Interval//EN:uinteger:%d\n",rinterval); 
        print "-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Entry Delimiter//EN:string:end"; 
        printf("\tDate: %s/%s/%s\n",substr(sdate,5,2),substr(sdate,7,2),substr(sdate,1,4));
-# The start/end time are in UTC and have to be converted to local time. We assume the local time is UTC+1     
+# The start/end time are in UTC and have to be converted to local time. We assume the local time is UTC+1 unless we know the shift from UTC.
        shour=substr(sdate,10,2);
        smin=substr(sdate,12,2);
        fhour=substr(fdate,10,2);
        fmin=substr(fdate,12,2);
        if ((fhour+fmin+shour+smin)==0) {fhour=01;fmin=42;shour=01;smin=41}
-       shour++; 
-       fhour++; 
+       shour+=timezone;
+       fhour+=timezone;
        printf("\tStart: %.2d%.2d\n",shour,smin) 
        printf("\tEnd: %.2d%.2d\n",fhour,fmin)
        if (rxtype==0) {print "\tRepeat: One Time"}; 
@@ -183,6 +187,75 @@ BEGIN {FS=":"}
        fdate="";
        appnt=0;
        summary="";
-    } 
+    } else if ($2~"VTODO") {
+
+# We are reproducing the code for repetition of an event above. This could be refactored as a function to make the program more elegant.
  
-}
+       if (runtil==1) {
+           uyear=substr(xuntil,1,4)-substr(sdate,1,4);
+           umonth=substr(xuntil,5,2)-substr(sdate,5,2);
+           uday=substr(xuntil,7,2)-substr(sdate,7,2);
+           if (rxtype==1) nxr=int(365.25*uyear+30.44*umonth+uday)+1;
+           if (rxtype==2) nxr=int((365.25*uyear+30.44*umonth+uday)/7.0)+1;
+           if (rxtype==3) nxr=int((365.25*uyear+30.44*umonth+uday)/14.0)+1;
+           if ((rxtype==4)||(rxtype==5)) nxr=12*uyear+umonth+1;
+           if (rxtype==6) nxr=uyear+1;
+           if (rxtype==7) nxr=int((365.25*uyear+30.44*umonth+uday)/xinterval)+1;
+           if (rxtype==8) nxr=int((365.25*uyear+30.44*umonth+uday)/(7*xinterval))+1;
+           if (rxtype==9) nxr=int((12*uyear+umonth)/xinterval)+1;
+           if (rxtype==10) nxr=int(5.0*(365.25*uyear+30.44*umonth+uday)/7.0)+1;
+           if (rxtype==11) nxr=int(3.0*(365.25*uyear+30.44*umounth+uday)/7.0)+1;
+           if (rxtype==12) nxr=int(3.0*(365.25*uyear+30.44*umounth+uday)/7.0)+1;
+           if (nxr<0) nxr=0;
+       };
+
+# Start hour and End hour have to be converted to UTC first if timezone is defined.
+
+       printf("\n\n")
+       print "\t** Calendar Appointment **"
+       print "-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Entry Delimiter//EN:string:begin";
+       printf("-//XAPIA/CSA/ENTRYATTR//NONSGML Start Date//EN:datetime:%s\n",ddate);
+       print "-//XAPIA/CSA/ENTRYATTR//NONSGML Type//EN:uinteger:1";
+       print "-//XAPIA/CSA/ENTRYATTR//NONSGML Classification//EN:uinteger:0";
+       print "-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Show Time//EN:sinteger:1"
+       print "-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Show Time//EN:sinteger:1";
+       printf("-//XAPIA/CSA/ENTRYATTR//NONSGML Summary//EN:string:%s\n",summary);
+       printf ("-//XAPIA/CSA/ENTRYATTR//NONSGML Status//EN:uinteger:%d\n",tsksts);
+       printf("-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Repeat Type//EN:sinteger:%d\n",rxtype);
+       printf("-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Repeat Times//EN:uinteger:%d\n",nxr);
+       print "-//XAPIA/CSA/ENTRYATTR//NONSGML Audio Reminder//EN:reminder:300:";
+       print "-//XAPIA/CSA/ENTRYATTR//NONSGML Popup Reminder//EN:reminder:300:";
+       print "-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Repeat Occurrence Number//EN:sinteger:-1";
+       printf("-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Repeat Interval//EN:uinteger:%d\n",rinterval);
+       print "-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Entry Delimiter//EN:string:end";
+       printf("\tDate: %s/%s/%s\n",substr(ddate,5,2),substr(ddate,7,2),substr(ddate,1,4));
+# The start/end time are in UTC and have to be converted to local time. We assume the local time is UTC+1 unless we have a numeric value for timezone shift.
+       shour=substr(ddate,10,2);
+       smin=substr(ddate,12,2);
+       if ((shour+smin)==0) {shour=01;smin=41}
+       shour+=timezone;
+       printf("\tStart: %.2d%.2d\n",shour,smin)
+       if (rxtype==0) {print "\tRepeat: One Time"};
+       if (rxtype==1) {print "\tRepeat: Daily"};
+       if (rxtype==2) {print "\tRepeat: Weekly"};
+       if (rxtype==3) {print "\tRepeat: Every Two Weeks"};
+       if (rxtype==4) {print "\tRepeat: Monthly By Weekday"};
+       if (rxtype==5) {print "\tRepeat: Monthly By Date"};
+       if (rxtype==6) {print "\tRepeat: Yearly"}
+       if (rxtype==7) {printf("\t Repeat Every %d days\n",xinterval)}
+       if (rxtype==8) {printf("\t Repeat Every %d weeks\n",xinterval)}
+       if (rxtype==9) {printf("\t Repeat Every %d months\n",xinterval)}
+       if (rxtype==10) {print "\tRepeat: Monday thru Friday"};
+       if (rxtype==11) {print "\tRepeat: Mon, Wed, Fri"};
+       if (rxtype==12) {print "\tRepeat: Tuesday, Thursday"};
+       printf("\tFor: %d\n",nxr);
+       printf("\tWhat: %s\n",summary);
+       printf("\t\n");
+       sdate="";
+       fdate="";
+       appnt=0;
+       summary="";
+       };
+
+
+}
\ No newline at end of file
index 9776070912e7a991902400297c9ab9c8ff91d524..bef2a0fbd3d13ad1795f9a6fab93e53a0da50e7f 100644 (file)
@@ -1413,20 +1413,20 @@ $set 27
 4 "IMAP"
 5 "POP2"
 
-6 "Automatic (system) delivery"
-
-7 "Mail server retrieval"
-8 "Server Protocol:"
-9 "Server Name:"
-10 "User Name:"
-11 "Password:"
-12 "Remember password"
-13 "Delete from server after retrieval"
-14 "Retrieve old messages"
-
-15 "Custom retrieval"
-16 "User Getmail command:"
-
-17 "Null INBOX path."
-18 "INBOX folder path:"
+6 "Distribucion Automatica (sistemo)"
+
+7 "Recoger del servidor de correo"
+8 "Protocolo del Servidor:"
+9 "Nombre del Servidor:"
+10 "Nombre del Usuario:"
+11 "Frase de Paso:"
+12 "Recordacion de la Frase de Paso"
+13 "Borrar del servidor despuès del recogimento"
+14 "Recoger viejos mensajes"
+
+15 "Recogimento Personal"
+16 "Mandamiento per recoger correo del usuario:"
+
+17 "Ningun ruta por buzón."
+18 "ruta por buzón local:"
 
index 9c75e6aa6d4d53656d97802327e4f0cffd33f6de..2b94c6d80c948ccd94a9e6025fb1527f711daad8 100644 (file)
@@ -191,13 +191,13 @@ $ Used to construct the label on the "Mail Retrieval" menu button in the
 $      "Category" option menu in the "Mailer - Options" dialog.
 $      This menu button is used to select printing options pane.
 $      This message is in the same menu as messages 4 - 10 above.
-$ "NEW-"
-93 "Mail Retrieval"
+$ "NEW-" (Recobrar is also possible)
+93 "Recoger el Correo"
 
 $ 
 $      Used to construct the label on the confirm attachment in the
 $      compose pane.
 $ "NEW-"
-94 "Confirm attachments over:"
+94 "Confirmar archivos adjuntos despuès:"
 $ "NEW-"
 95 "kilobytes"
index 15d074efe043ca73c4a9028e42e96aa78bf55752..0a713cd9a729d6b6e3965f40e05d0e35d94d99ac 100644 (file)
@@ -726,7 +726,7 @@ $ "-NEW"
 262 "lettre morte message"
 
 $ "-NEW"
-263 "The attachment '%s' is %d kilobytes.\nAdd as attachment?"
+263 "La pièce jointe '%s' prend %d kilooctets.\nAjouter la p.-j. ?"
 
 
 
@@ -1414,20 +1414,20 @@ $set 27
 4 "IMAP"
 5 "POP2"
 
-6 "Automatic (system) delivery"
+6 "Distribution (système) automatique"
 
-7 "Mail server retrieval"
-8 "Server Protocol:"
-9 "Server Name:"
-10 "User Name:"
-11 "Password:"
-12 "Remember password"
-13 "Delete from server after retrieval"
-14 "Retrieve old messages"
+7 "Récupération sur serveur distant"
+8 "Protocole du serveur:"
+9 "Nom du Serveur:"
+10 "Nom Utilisateur:"
+11 "Mot de Passe:"
+12 "Retenir le mot de passe"
+13 "Effacer du serveur après récupération"
+14 "Récupérer les anciens messages"
 
-15 "Custom retrieval"
-16 "User Getmail command:"
+15 "Récupération personnalisée"
+16 "commande à éxécuter:"
 
-17 "Null INBOX path."
-18 "INBOX folder path:"
+17 "Pas de chemin pour la boîte aux lettres."
+18 "Chemin de la boîte aux lettres locale :"
 
index d4d7f87a66605896db09e1a48bea5237b3d6abdc..1fc4f05d8daaf9cde516b778bf39578f1f6786b4 100644 (file)
@@ -1251,7 +1251,7 @@ $
 $ Message 465 - the square root key
 $ 
 
-466 "a"
+466 "w"
 $ 
 $ Message 467 - the Bsp (backspace) key.
 $  \010 is "Control h"
index 41d3584c4413ed02279eb370c284bfd8490e6fc6..c57f0b01364f6c39a082f9d033aa2a1dee62aeee 100644 (file)
@@ -22,7 +22,7 @@ $
 1 Le processus de la session tt n'est pas lancé et le service ToolTalk\n\
 ne peut pas le relancer.
 2 L'identificateur courant du processus par défaut est périmé ou incorrect.
-3 La session ToolTalk sécifiée est périmée ou incorrecte.
+3 La session ToolTalk spécifiée est périmée ou incorrecte.
 
 $ 
 $ Message 4: Do not localize the word DtInfo_Start.
index 19794ea9cfa7cbf67232a4a4cacfa787a7d86af1..6a906796d8091bc7f348d7047697b649718e5ad4 100644 (file)
@@ -27,9 +27,9 @@ $ ** You can edit this comment and add comments below each message.
 
 4 "Vue message"
 
-5 "Composition fenêtre"
+5 "Fenêtre de composition"
 
-6 "Archivage messages"
+6 "Archivage des messages"
 
 7 "Congés"
 
@@ -192,12 +192,12 @@ $ "Category" option menu in the "Mailer - Options" dialog.
 $      This menu button is used to select printing options pane.
 $      This message is in the same menu as messages 4 - 10 above.
 $ "NEW-"
-93 "Mail Retrieval"
+93 "Récupération Courrier"
 
 $ 
 $      Used to construct the label on the confirm attachment in the
 $      compose pane.
 $ "NEW-"
-94 "Confirm attachments over:"
+94 "Confirmer pièces-jointes après:"
 $ "NEW-"
-95 "kilobytes"
+95 "kilooctets"
index c909c11d2745d01fb6bc00e78eb76fc1af1b0d9f..5662bb3a5712625a893598054c7a7b363bb19482 100644 (file)
@@ -97,7 +97,7 @@ $ Do not Translate
 32 "zone rec_info incorrecte dans l'option -w\n"
 $ do not translate "rec_info" or "-w"  
 
-33 "Option introuvabel dans -w ou -l\n"
+33 "Option introuvable dans -w ou -l\n"
 $ do not translate "-w" or "-l"  
 
 34 "Option inconnue\n"
index 1ec43f8c4f92b6a11ad82f423ec64b1dc53a6f78..c34cd60c1c2d9b1047b1270add535be2eb24b864 100644 (file)
@@ -1104,20 +1104,19 @@ $set 27
 4 "IMAP"
 5 "POP2"
 
-6 "Automatic (system) delivery"
-
-7 "Mail server retrieval"
-8 "Server Protocol:"
-9 "Server Name:"
-10 "User Name:"
-11 "Password:"
-12 "Remember password"
-13 "Delete from server after retrieval"
-14 "Retrieve old messages"
-
-15 "Custom retrieval"
-16 "User Getmail command:"
-
-17 "Null INBOX path."
-18 "INBOX folder path:"
-
+6 "Distribuzione (sistemo) automatica"
+
+7 "ricupero dal Mailserver"
+8 "Protocollo del Server:"
+9 "Nome Server:"
+10 "Nome Utento:"
+11 "Passaparola:"
+12 "Ricorda passaparola"
+13 "Cancellare dal server dopo ricupero"
+14 "Ricupera vecchi messagi"
+
+15 "Ricupero personalizzato"
+16 "Utento Getmail commanda:"
+
+17 "Nessun percorso per la casella postale."
+18 "percorso della casella postale:"
index fed04b488ab170d4e6dd9614a98a7161e0e8f438..b5ad2f61e7d0d2430edc858de1a03d61c3f4f646 100644 (file)
@@ -111,12 +111,12 @@ $ "Category" option menu in the "Mailer - Options" dialog.
 $      This menu button is used to select printing options pane.
 $      This message is in the same menu as messages 4 - 10 above.
 $ "NEW-"
-93 "Mail Retrieval"
+93 "Ricupero Posta"
 
 $ 
 $      Used to construct the label on the confirm attachment in the
 $      compose pane.
 $ "NEW-"
-94 "Confirm attachments over:"
+94 "Conferma allegati dopo:"
 $ "NEW-"
 95 "kilobytes"