]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Translation on login screen is working
authorJean-Marc Pigeon <jmp@safe.c>
Sat, 6 Sep 2025 17:53:27 +0000 (13:53 -0400)
committerJean-Marc Pigeon <jmp@safe.c>
Sat, 6 Sep 2025 17:53:27 +0000 (13:53 -0400)
www/lvllog.php
www/translations.js

index 5521088ec2a3d7f14d5c81d322cb287db47284c8..daa4041659a8ce875738d68cf1b4a84074764ac3 100644 (file)
@@ -57,9 +57,8 @@ $STR  = <<<EOT
                   <td align="left" nowrap="nowrap"><span class="translatable" trkey="Password">Password</span><span>:</span></td>
                   <td>
                  <input type="password" name="passwd" size="20" id="myInput" />
-                  <input type="checkbox" onclick="showpass()"
-                     
-                    ><span class="translatable" trkey="Show" >Show</span>
+                  <input type="checkbox" onclick="showpass()">
+                    <span class="translatable" trkey="Show" >Show</span>
                  </td>
                 </tr>
               </table>
@@ -71,7 +70,8 @@ $STR  = <<<EOT
                     <table>
                       <tr>
                         <td align="center">
-                       <input type="submit" name="loginbutton" value="Login" />
+                        <input type="submit" name="loginbutton" value="Login" 
+                        class="translatable" trkey="Login" />
                        </td>
                       </tr>
                     </table>
index c3fce8e38ee2223a007639c2896ba341d4030aae..fffb2dbbcf0a9d72cae3237d453c15ad72eb136c 100644 (file)
@@ -4,11 +4,13 @@ var translationEn = new Map();
 translationEn.set("Email","Email");
 translationEn.set("Password","Password");
 translationEn.set("Show","Show");
+translationEn.set("Login","Login");
 
 var translationFr = new Map();
 translationFr.set("Email", "Courriel");
 translationFr.set("Password","Mot de passe");
 translationFr.set("Show","Afficher");
+translationFr.set("Login","Action");
 
 translationMap.set("fr", translationFr);
 translationMap.set("en", translationEn);
@@ -37,8 +39,13 @@ function updateTranslations()
  let translatables = document.getElementsByClassName("translatable");
  for(var i of translatables){
        let key = i.getAttribute("trkey");
+        if (i.tagName === 'INPUT')
+        {
+        i.value = translationMap.get(translationLng).get(key);
+        }
+        else {
         i.innerHTML = translationMap.get(translationLng).get(key);
-
+        }
  }
 
 }