// 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
}
}
+//==============================================================
+//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();
//==============================================================