diff --git a/public/language/en-US/error.json b/public/language/en-US/error.json index 4191fad..349c5cb 100644 --- a/public/language/en-US/error.json +++ b/public/language/en-US/error.json @@ -31,7 +31,7 @@ "invalid-path": "Invalid path", "folder-exists": "Folder exists", "invalid-pagination-value": "Invalid pagination value, must be at least %1 and at most %2", - "username-taken": "Username taken", + "username-taken": "Username taken. Try %1", "email-taken": "Email taken", "email-nochange": "The email entered is the same as the email already on file.", "email-invited": "Email was already invited", diff --git a/public/src/client/register.js b/public/src/client/register.js index 62dbc41..6e4eb95 100644 --- a/public/src/client/register.js +++ b/public/src/client/register.js @@ -111,6 +111,7 @@ define('forum/register', [ $('#username').focus(); }; + // error lies within this function function validateUsername(username, callback) { callback = callback || function () {}; @@ -131,7 +132,11 @@ define('forum/register', [ if (results.every(obj => obj.status === 'rejected')) { showSuccess(username_notify, successIcon); } else { - showError(username_notify, '[[error:username-taken]]'); + // this is the case where the already username is taken + // I added a new suffix and add it into the username + const suffix = '1234'; + showError(username_notify, `[[error:username-taken, ${username}${suffix}]]`); + // showError(username_notify, `Username taken. Try ${username}${suffix}]]`); } callback();