translate error messages

This commit is contained in:
DOHA 2015-04-04 11:17:26 +02:00
parent 22966a8897
commit b61e32ab48
4 changed files with 30 additions and 16 deletions

View File

@ -69,4 +69,11 @@ message.updatePasswordSuc=Password updated successfully
message.changePassword=Change Password message.changePassword=Change Password
message.invalidOldPassword=Invalid Old Password message.invalidOldPassword=Invalid Old Password
label.user.newPassword=New Password label.user.newPassword=New Password
label.user.oldPassword=Old Password label.user.oldPassword=Old Password
error.wordLength=Your password is too short
error.wordNotEmail=Do not use your email as your password
error.wordSequences=Your password contains sequences
error.wordLowercase=Use lower case characters
error.wordUppercase=Use upper case characters
error.wordOneNumber=Use numbers
error.wordOneSpecialChar=Use special characters

View File

@ -69,4 +69,11 @@ message.updatePasswordSuc=Contrase
message.changePassword=Cambiar La Contraseña message.changePassword=Cambiar La Contraseña
message.invalidOldPassword=Inválida contraseña antigua message.invalidOldPassword=Inválida contraseña antigua
label.user.newPassword=Nueva Contraseña label.user.newPassword=Nueva Contraseña
label.user.oldPassword=Contraseña Anterior label.user.oldPassword=Contraseña Anterior
error.wordLength=Tu contraseña es demasiado corta
error.wordNotEmail=No utilice su dirección de correo electrónico como contraseña
error.wordSequences=Su contraseña contiene secuencias
error.wordLowercase=Utilice caracteres en minúsculas
error.wordUppercase=Utilice mayúsculas
error.wordOneNumber=Utilice números
error.wordOneSpecialChar=Utilice los caracteres especiales

View File

@ -61,7 +61,7 @@
} }
</script> </script>
<style type="text/css"> <style type="text/css">
.wrapper{width:400px;margin-left:auto;margin-right:auto} .wrapper{width:500px;margin-left:auto;margin-right:auto}
label{padding-left:0 !important} label{padding-left:0 !important}
</style> </style>
</head> </head>
@ -84,12 +84,12 @@ ${param.message}
<form name='f' action="j_spring_security_check" method='POST' <form name='f' action="j_spring_security_check" method='POST'
onsubmit="return validate();"> onsubmit="return validate();">
<label class="col-sm-2"><spring:message code="label.form.loginEmail"></spring:message></label> <label class="col-sm-4"><spring:message code="label.form.loginEmail"></spring:message></label>
<span class="col-sm-10"><input class="form-control" type='text' name='j_username' value=''></span> <span class="col-sm-8"><input class="form-control" type='text' name='j_username' value=''></span>
<br><br> <br><br>
<label class="col-sm-2"><spring:message code="label.form.loginPass"></spring:message></label> <label class="col-sm-4"><spring:message code="label.form.loginPass"></spring:message></label>
<span class="col-sm-10"><input class="form-control" type='password' name='j_password' /></span> <span class="col-sm-8"><input class="form-control" type='password' name='j_password' /></span>
<br><br> <br><br>
<input class="btn btn-primary" name="submit" type="submit" <input class="btn btn-primary" name="submit" type="submit"

View File

@ -70,7 +70,7 @@ $(document).ready(function () {
$(":password").keyup(function(){ $(":password").keyup(function(){
if($("#password").val() != $("#matchPassword").val()){ if($("#password").val() != $("#matchPassword").val()){
$("#globalError").show().html("Password mismatch"); $("#globalError").show().html('<spring:message code="PasswordMatches.user"></spring:message>');
}else{ }else{
$("#globalError").html("").hide(); $("#globalError").html("").hide();
} }
@ -82,13 +82,13 @@ $(document).ready(function () {
showVerdictsInsideProgressBar:true, showVerdictsInsideProgressBar:true,
showErrors:true, showErrors:true,
errorMessages:{ errorMessages:{
wordLength: "Your password is too short", wordLength: '<spring:message code="error.wordLength"/>',
wordNotEmail: "Do not use your email as your password", wordNotEmail: '<spring:message code="error.wordNotEmail"/>',
wordSequences: "Your password contains sequences", wordSequences: '<spring:message code="error.wordSequences"/>',
wordLowercase: "Use lower case characters", wordLowercase: '<spring:message code="error.wordLowercase"/>',
wordUppercase: "Use upper case characters", wordUppercase: '<spring:message code="error.wordUppercase"/>',
wordOneNumber: "Use numbers", wordOneNumber: '<spring:message code="error.wordOneNumber"/>',
wordOneSpecialChar: "Use special characters" wordOneSpecialChar: '<spring:message code="error.wordOneSpecialChar"/>'
} }
} }
}; };
@ -100,7 +100,7 @@ function register(event){
$(".alert").html("").hide(); $(".alert").html("").hide();
$(".error-list").html(""); $(".error-list").html("");
if($("#password").val() != $("#matchPassword").val()){ if($("#password").val() != $("#matchPassword").val()){
$("#globalError").show().html("Password mismatch"); $("#globalError").show().html('<spring:message code="PasswordMatches.user"></spring:message>');
return; return;
} }
var formData= $('form').serialize(); var formData= $('form').serialize();