GUAC-1176: Use translation strings for client error messages.

This commit is contained in:
Michael Jumper
2015-06-03 16:28:47 -07:00
parent 304e150a1e
commit 904e54090f
5 changed files with 20 additions and 4 deletions

View File

@@ -124,11 +124,11 @@ public class UserContextService {
// New password must be different from old password // New password must be different from old password
if (newPassword.equals(credentials.getPassword())) if (newPassword.equals(credentials.getPassword()))
throw new GuacamoleClientException("The new password must be different from the expired password."); throw new GuacamoleClientException("LOGIN.ERROR_PASSWORD_SAME");
// New password must not be blank // New password must not be blank
if (newPassword.isEmpty()) if (newPassword.isEmpty())
throw new GuacamoleClientException("The new password may not be blank."); throw new GuacamoleClientException("LOGIN.ERROR_PASSWORD_BLANK");
// STUB: Change password if new password given // STUB: Change password if new password given
logger.info("Resetting expired password of user \"{}\".", user.getIdentifier()); logger.info("Resetting expired password of user \"{}\".", user.getIdentifier());

View File

@@ -1,4 +1,10 @@
{ {
"LOGIN" : {
"ERROR_PASSWORD_BLANK" : "@:APP.ERROR_PASSWORD_BLANK",
"ERROR_PASSWORD_SAME" : "The new password must be different from the expired password."
},
"USER_ATTRIBUTES" : { "USER_ATTRIBUTES" : {
"FIELD_HEADER_DISABLED" : "Login disabled:", "FIELD_HEADER_DISABLED" : "Login disabled:",
@@ -7,4 +13,5 @@
"SECTION_HEADER_RESTRICTIONS" : "Account Restrictions" "SECTION_HEADER_RESTRICTIONS" : "Account Restrictions"
} }
} }

View File

@@ -0,0 +1,7 @@
{
"LOGIN" : {
"ERROR_PASSWORD_BLANK" : "@:APP.ERROR_PASSWORD_BLANK"
}
}

View File

@@ -23,6 +23,7 @@
"DIALOG_HEADER_ERROR" : "Error", "DIALOG_HEADER_ERROR" : "Error",
"ERROR_PASSWORD_BLANK" : "Your password cannot be blank.",
"ERROR_PASSWORD_MISMATCH" : "The provided passwords do not match.", "ERROR_PASSWORD_MISMATCH" : "The provided passwords do not match.",
"FIELD_HEADER_PASSWORD" : "Password:", "FIELD_HEADER_PASSWORD" : "Password:",
@@ -435,7 +436,7 @@
"DIALOG_HEADER_ERROR" : "@:APP.DIALOG_HEADER_ERROR", "DIALOG_HEADER_ERROR" : "@:APP.DIALOG_HEADER_ERROR",
"ERROR_PASSWORD_BLANK" : "Your password cannot be blank.", "ERROR_PASSWORD_BLANK" : "@:APP.ERROR_PASSWORD_BLANK",
"ERROR_PASSWORD_MISMATCH" : "@:APP.ERROR_PASSWORD_MISMATCH", "ERROR_PASSWORD_MISMATCH" : "@:APP.ERROR_PASSWORD_MISMATCH",
"FIELD_HEADER_LANGUAGE" : "Display language:", "FIELD_HEADER_LANGUAGE" : "Display language:",

View File

@@ -23,6 +23,7 @@
"DIALOG_HEADER_ERROR" : "Ошибка", "DIALOG_HEADER_ERROR" : "Ошибка",
"ERROR_PASSWORD_BLANK" : "Пароль не может быть пустым.",
"ERROR_PASSWORD_MISMATCH" : "Указанные пароли не совпадают.", "ERROR_PASSWORD_MISMATCH" : "Указанные пароли не совпадают.",
"FIELD_HEADER_PASSWORD" : "Пароль:", "FIELD_HEADER_PASSWORD" : "Пароль:",
@@ -414,7 +415,7 @@
"DIALOG_HEADER_ERROR" : "@:APP.DIALOG_HEADER_ERROR", "DIALOG_HEADER_ERROR" : "@:APP.DIALOG_HEADER_ERROR",
"ERROR_PASSWORD_BLANK" : "Пароль не может быть пустым.", "ERROR_PASSWORD_BLANK" : "@:APP.ERROR_PASSWORD_BLANK",
"ERROR_PASSWORD_MISMATCH" : "@:APP.ERROR_PASSWORD_MISMATCH", "ERROR_PASSWORD_MISMATCH" : "@:APP.ERROR_PASSWORD_MISMATCH",
"FIELD_HEADER_LANGUAGE" : "Язык:", "FIELD_HEADER_LANGUAGE" : "Язык:",