Translated login page.

This commit is contained in:
Pierre 2018-02-04 09:42:38 +01:00
parent cfd671f7e8
commit df877ed6be
4 changed files with 39 additions and 8 deletions

View File

@ -4,7 +4,18 @@
* @author Pierre HUBERT * @author Pierre HUBERT
*/ */
ComunicWeb.common.langs.en = { ComunicWeb.common.langs.en = {
//Error messages //Error messages
"__fatal_error": "Fatal error", "__fatal_error": "Fatal error",
"__fatal_error_explanation": "A fatal error occured : <i>%p</i>. Please try to refresh the page...", "__fatal_error_explanation": "A fatal error occured : <i>%p</i>. 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 !",
} }

View File

@ -4,7 +4,18 @@
* @author Pierre HUBERT * @author Pierre HUBERT
*/ */
ComunicWeb.common.langs.fr = { ComunicWeb.common.langs.fr = {
//Error messages //Error messages
"__fatal_error": "Erreur fatale", "__fatal_error": "Erreur fatale",
"__fatal_error_explanation": "Une erreur fatale a survenue : <i>%p</i>. Veuillez réessayer de recharger la page...", "__fatal_error_explanation": "Une erreur fatale a survenue : <i>%p</i>. 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...",
} }

View File

@ -31,10 +31,19 @@ ComunicWeb.pages.login = {
} }
//Prepare additional data //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 //Preparing next actions
var afterParsingTemplate = function(){ var afterParsingTemplate = function(){
//Change body class name //Change body class name
document.body.className = "login-page hold-transition"; document.body.className = "login-page hold-transition";
@ -92,7 +101,7 @@ ComunicWeb.pages.login = {
ComunicWeb.common.formChecker.checkInput(userpasswordInput, true) //Check password input ComunicWeb.common.formChecker.checkInput(userpasswordInput, true) //Check password input
)){ )){
//Error notification //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 //Stop function execution
return false; return false;
@ -137,7 +146,7 @@ ComunicWeb.pages.login = {
*/ */
displayLoginError: function(){ displayLoginError: function(){
//Create error modal //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 //Apply error modal
document.getElementById('loginMessagesTarget').innerHTML = ""; document.getElementById('loginMessagesTarget').innerHTML = "";

View File

@ -6,31 +6,31 @@
<div class="login-box-body"> <div class="login-box-body">
<!-- Login message --> <!-- Login message -->
<p class="login-box-msg">Login to your Comunic account.</p> <p class="login-box-msg">{login_top_msg}</p>
<!-- Optionnal messages target --> <!-- Optionnal messages target -->
<div id="loginMessagesTarget"></div> <div id="loginMessagesTarget"></div>
<form id="loginForm" action="javascript:(function(){})();"> <form id="loginForm" action="javascript:(function(){})();">
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<input type="email" class="form-control" placeholder="Email" id="usermail" /> <input type="email" class="form-control" placeholder="{email}" id="usermail" />
<span class="glyphicon glyphicon-envelope form-control-feedback"></span> <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<input type="password" class="form-control" placeholder="Password" id="userpassword" /> <input type="password" class="form-control" placeholder="{password}" id="userpassword" />
<span class="glyphicon glyphicon-lock form-control-feedback"></span> <span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-8"> <div class="col-xs-8">
<div class="checkbox icheck"> <div class="checkbox icheck">
<label> <label>
<input type="checkbox" id="rememberLogin" checked /> Remember Me <input type="checkbox" id="rememberLogin" checked /> {_login_page_remember_me}
</label> </label>
</div> </div>
</div> </div>
<!-- /.col --> <!-- /.col -->
<div class="col-xs-4"> <div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat btn-login">Sign In</button> <button type="submit" class="btn btn-primary btn-block btn-flat btn-login">{sign_in}</button>
</div> </div>
<!-- /.col --> <!-- /.col -->
</div> </div>