]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Starting to impllement, column header automatique translation
authorJean-Marc Pigeon <jmp@safe.c>
Fri, 12 Dec 2025 01:24:39 +0000 (20:24 -0500)
committerJean-Marc Pigeon <jmp@safe.c>
Fri, 12 Dec 2025 01:24:39 +0000 (20:24 -0500)
www/gesdis.php
www/lvllog.php
www/lvlmai.php
www/translations.js

index 2cc8da1320345bb8844bffa5f67f561fa5dae589..b4a39827856013ab9b0cd2112907d33cea3e9b23 100644 (file)
@@ -78,6 +78,10 @@ $entete
 <table cellpadding="0" cellspacing="0" width="100%" border="0">
 <tr>
   <td width="50%">
+  <select id="first-choice" onchange="updateTranslations()">
+    <option value="en">en</option>
+    <option value="fr">fr</option>
+  </select>
   <FONT COLOR=$admcolor>$logname</FONT>
   </td>
   <td width="50%">
@@ -169,7 +173,7 @@ function starthtml($js)
 $JSTR=NULL;
 if ($js!=NULL) {
   $JSTR = <<<EOT
-  <script defer src="$js.js"></script>
+  <script defer src="$js.js?v=<?= time() ?>"></script>
   EOT;
   }
 
index d0f465ab9397e7a5a4a993268f4baa9aeb90ef60..fd0b774ae1e49360edbd6eb421dc46e124348d4e 100644 (file)
@@ -43,10 +43,6 @@ $STR  = <<<EOT
                   <td align="left" nowrap="nowrap"><span class="translatable" trkey="Email">Email</span><span>:</span></td>
                   <td>
                   <input  tabindex="1" type="text" name="email" size="40" onchange="" />
-                  <select id="first-choice" onchange="updateTranslations()">
-                    <option value="en">English</option>
-                    <option value="fr">Francais</option>
-                  </select>
                   </td>
                 </tr>
 
index 9936f8def534dc0ba25f98d83b382f0c2140cb08..45d52a6b0aed1e1fbaa5d68f6c7c790f629cd16a 100644 (file)
@@ -243,8 +243,8 @@ $tblheader
 <TH align=center>$hdate</TH>
 <TH align=center>IP</TH>
 <TH align=center>Reverse Address</TH>
-<TH align=center>$horiginator</TH>
-<TH align=center>$hrecipient</TH>
+<TH align=center><span class="translatable" trkey="Originator">Originator</span></TH>
+<TH align=center><span class="translatable" trkey="Recipient">Recipient</span></TH>
 <TH align=center>Subject</TH>
 </TR>
 $line
index 23cb16b8bdd0f83d294ac9ed3e5a88f695fe3f43..6b8db517734aa0c7f429d04a953bf4670abb0ac3 100644 (file)
@@ -1,38 +1,29 @@
 // vim: smarttab tabstop=8 shiftwidth=2 expandtab
 
+// Table unique, même style que le PHP
+const TR = [
+    ["Authentication",  "Authentification"],
+    ["Email",           "Courriel"],
+    ["Login",           "Connexion"],
+    ["Originator",      "Expediteur"],
+    ["Password",        "Mot de passe"],
+    ["Recipient",       "Destinataire"],
+    ["Show",            "Afficher"]
+];
+
 var translationMap = new Map();
 
-var translationEn = new Map();
-translationEn.set("Authentication","Authentication");
-translationEn.set("Email","Email");
-translationEn.set("Login","Login");
-translationEn.set("Password","Password");
-translationEn.set("Show","Show");
+// On construit automatiquement les dictionnaires EN/FR
+const translationEn = new Map();
+const translationFr = new Map();
 
-var translationFr = new Map();
-translationFr.set("Authentication","Authentification");
-translationFr.set("Email","Courriel");
-translationFr.set("Login","Connexion");
-translationFr.set("Password","Mot de passe");
-translationFr.set("Show","Afficher");
+for (const [en, fr] of TR) {
+  translationEn.set(en, en);
+  translationFr.set(en, fr);
+  }
 
-translationMap.set("fr", translationFr);
 translationMap.set("en", translationEn);
-
-//==============================================================
-//function to show password contents
-//==============================================================
-function showpass()
-
-{
-let datain=document.getElementById("myInput");
-if (datain.type==="password") {
-  datain.type="text";
-  }
-else {
-  datain.type="password";
-  }
-}
+translationMap.set("fr", translationFr);
 
 //==============================================================
 //function to translate login screen
@@ -53,6 +44,21 @@ for (var i of translatables) {
   }
 }
 
+//==============================================================
+//function to show password contents
+//==============================================================
+function showpass()
+
+{
+let datain=document.getElementById("myInput");
+if (datain.type==="password") {
+  datain.type="text";
+  }
+else {
+  datain.type="password";
+  }
+}
+
 //execute function at first display
 updateTranslations();
 //==============================================================