From df877ed6be20a6b225d4d1314a7af4f26c76a0d0 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 4 Feb 2018 09:42:38 +0100 Subject: [PATCH] Translated login page. --- assets/js/langs/en.inc.js | 11 +++++++++++ assets/js/langs/fr.inc.js | 11 +++++++++++ assets/js/pages/login.js | 15 ++++++++++++--- assets/templates/pages/login/loginPage.tpl | 10 +++++----- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/assets/js/langs/en.inc.js b/assets/js/langs/en.inc.js index 96cbffdf..2ed71171 100644 --- a/assets/js/langs/en.inc.js +++ b/assets/js/langs/en.inc.js @@ -4,7 +4,18 @@ * @author Pierre HUBERT */ ComunicWeb.common.langs.en = { + //Error messages "__fatal_error": "Fatal error", "__fatal_error_explanation": "A fatal error occured : %p. Please try to refresh the page...", + + //Login form + _login_page_top_msg: "Login to your Comunic account.", + _login_page_remember_me: "Rememeber me", + _login_page_email_placeholder: "Email", + _login_page_password_placeholder: "Password", + _login_page_submit: "Sign In", + _login_page_error_head: "Login failed", + _login_page_error_message: "Please check your usermail and password !", + _login_page_bad_input: "Please check what you've typed !", } \ No newline at end of file diff --git a/assets/js/langs/fr.inc.js b/assets/js/langs/fr.inc.js index ce6fe2fe..14535231 100644 --- a/assets/js/langs/fr.inc.js +++ b/assets/js/langs/fr.inc.js @@ -4,7 +4,18 @@ * @author Pierre HUBERT */ ComunicWeb.common.langs.fr = { + //Error messages "__fatal_error": "Erreur fatale", "__fatal_error_explanation": "Une erreur fatale a survenue : %p. Veuillez réessayer de recharger la page...", + + //Login form + _login_page_top_msg: "Connectez-vous à votre compte Comunic.", + _login_page_remember_me: "Se souvenir de moi", + _login_page_email_placeholder: "Email", + _login_page_password_placeholder: "Mot de passe", + _login_page_submit: "Connexion", + _login_page_error_head: "La connexion a échouée", + _login_page_error_message: "Veuillez vérifier votre identifiant et votre mot de passe !", + _login_page_bad_input: "Veuillez vérifier votre saisie...", } \ No newline at end of file diff --git a/assets/js/pages/login.js b/assets/js/pages/login.js index a16e5c66..da221878 100644 --- a/assets/js/pages/login.js +++ b/assets/js/pages/login.js @@ -31,10 +31,19 @@ ComunicWeb.pages.login = { } //Prepare additional data - var additionalTemplateData = {}; + var additionalTemplateData = { + + //Apply translations + "login_top_msg": lang("_login_page_top_msg"), + "_login_page_remember_me": lang("_login_page_remember_me"), + "email": lang("_login_page_email_placeholder"), + "password": lang("_login_page_password_placeholder"), + "sign_in": lang("_login_page_submit"), + }; //Preparing next actions var afterParsingTemplate = function(){ + //Change body class name document.body.className = "login-page hold-transition"; @@ -92,7 +101,7 @@ ComunicWeb.pages.login = { ComunicWeb.common.formChecker.checkInput(userpasswordInput, true) //Check password input )){ //Error notification - ComunicWeb.common.notificationSystem.showNotification("Please check what you've typed !", "error"); + ComunicWeb.common.notificationSystem.showNotification(lang("_login_page_bad_input"), "error"); //Stop function execution return false; @@ -137,7 +146,7 @@ ComunicWeb.pages.login = { */ displayLoginError: function(){ //Create error modal - errorMessageElem = ComunicWeb.common.messages.createCalloutElem("Login failed", "Please check your usermail and password", "danger"); + errorMessageElem = ComunicWeb.common.messages.createCalloutElem(lang("_login_page_error_head"), lang("_login_page_error_message"), "danger"); //Apply error modal document.getElementById('loginMessagesTarget').innerHTML = ""; diff --git a/assets/templates/pages/login/loginPage.tpl b/assets/templates/pages/login/loginPage.tpl index be84edbf..aa993713 100644 --- a/assets/templates/pages/login/loginPage.tpl +++ b/assets/templates/pages/login/loginPage.tpl @@ -6,31 +6,31 @@
- +
- +
- +
- +