From ec7abaaf14c86bf02d9dbf45c646c5caa9ef1706 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 3 Aug 2018 15:07:59 +0200 Subject: [PATCH] Translated create account page. --- assets/js/langs/en.inc.js | 15 +++++++++++++++ assets/js/pages/createAccount.js | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/assets/js/langs/en.inc.js b/assets/js/langs/en.inc.js index da6ce407..fb88e136 100644 --- a/assets/js/langs/en.inc.js +++ b/assets/js/langs/en.inc.js @@ -83,4 +83,19 @@ ComunicWeb.common.langs.en = { form_create_account_last_name_placeholder: "Your last name", form_create_account_email_address_label: "Email address Warning! You will not be able to change this later !", form_create_account_email_address_placeholder: "Your email address", + form_create_account_password_label: "Password", + form_create_account_password_placeholder: "Your password", + form_create_account_confirm_password_label: "Confirm your password", + form_create_account_confirm_password_placeholder: "Your password", + form_create_account_terms_label: "I have read and accepted the terms of use of the network", + form_create_account_submit: "Create the account", + form_create_account_login_with_existing: "Login with an existing account", + form_create_account_err_need_accept_terms: "Please read and accept the terms of use of the website!", + form_create_account_err_need_first_name: "Please check your first name !", + form_create_account_err_check_last_name: "Please check your last name !", + form_create_account_err_check_email_address: "Please check your email address !", + form_create_account_err_check_password: "Please check your password !", + form_create_account_err_passwd_differents: "The two passwords are not the same !", + form_create_account_err_create_account_message: "An error occured while trying to create your account. It is most likely to be a server error, or the given email address is already associated with an account.", + form_create_account_err_create_account_title: "Account creation failed", } \ No newline at end of file diff --git a/assets/js/pages/createAccount.js b/assets/js/pages/createAccount.js index 397bbe05..bf14fa9a 100644 --- a/assets/js/pages/createAccount.js +++ b/assets/js/pages/createAccount.js @@ -80,23 +80,23 @@ ComunicWeb.pages.createAccount = { //Input user password var passwordInput = createFormGroup({ target: formRoot, - label: "Password", - placeholder: "Your password", + label: lang("form_create_account_password_label"), + placeholder: lang("form_create_account_password_placeholder"), type: "password" }); //Confirm user password var confirmPasswordInput = createFormGroup({ target: formRoot, - label: "Confirm your password", - placeholder: "Your password", + label: lang("form_create_account_confirm_password_label"), + placeholder: lang("form_create_account_confirm_password_placeholder"), type: "password" }); //Terms of use must have been accepted var siteTerms = createFormGroup({ target: formRoot, - label: "I have read and accepted the terms of use of the network", + label: lang("form_create_account_terms_label", [ComunicWeb.__config.aboutWebsiteURL+"about/terms/"]), type: "checkbox" }); @@ -110,7 +110,7 @@ ComunicWeb.pages.createAccount = { appendTo: submitButtonContainer, type: "button", class: "btn btn-primary", - innerHTML: "Create the account" + innerHTML: lang("form_create_account_submit") }); //Add bottom links area @@ -124,7 +124,7 @@ ComunicWeb.pages.createAccount = { var loginLink = createElem2({ appendTo: bottomLinks, type: "a", - innerHTML: "Login with an existing account" + innerHTML: lang("form_create_account_login_with_existing") }); loginLink.onclick = function(){ openPage("login"); @@ -139,27 +139,27 @@ ComunicWeb.pages.createAccount = { //Check the terms of use have been accepted if(!siteTerms.checked) - return notify("Please read and accept the terms of use of the website!", "danger"); + return notify(lang("form_create_account_err_need_accept_terms"), "danger"); //Check the first name if(!ComunicWeb.common.formChecker.checkInput(firstNameInput, true)) - return notify("Please check your first name !", "danger"); + return notify(lang("form_create_account_err_need_first_name"), "danger"); //Check the last name if(!ComunicWeb.common.formChecker.checkInput(lastNameInput, true)) - return notify("Please check your last name !", "danger"); + return notify(lang("form_create_account_err_check_last_name"), "danger"); //Check the email address if(!ComunicWeb.common.formChecker.checkInput(emailInput, true)) - return notify("Please check your email address !", "danger"); + return notify(lang("form_create_account_err_check_email_address"), "danger"); //Check the password if(!ComunicWeb.common.formChecker.checkInput(passwordInput, true)) - return notify("Please check your password !", "danger"); + return notify(lang("form_create_account_err_check_password"), "danger"); //Check the confirmation password if(passwordInput.value != confirmPasswordInput.value) - return notify("The two passwords are not the same !", "danger"); + return notify(lang("form_create_account_err_passwd_differents"), "danger"); //Lock create account button submitButton.disabled = true; @@ -179,8 +179,8 @@ ComunicWeb.pages.createAccount = { if(response.error){ //Display an error messagesTarget.appendChild(ComunicWeb.common.messages.createCalloutElem( - "Account creation failed", - "An error occured while trying to create your account. It is most likely to be a server error, or the given email address is already associated with an account.", + lang("form_create_account_err_create_account_title"), + lang("form_create_account_err_create_account_message"), "danger" )); return;