Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion public/src/client/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,28 @@ define('forum/register', [
if (results.every(obj => obj.status === 'rejected')) {
showSuccess(username_notify, successIcon);
} else {
showError(username_notify, '[[error:username-taken]]');
// --- NEW: suggest an alternative username ---
const suggestion = username + 'suffix';
translator.translate('[[error:username-taken]]', function (msg) {
username_notify.html(
msg + ' ' +
'Try this instead: ' +
`<strong>${suggestion}</strong>`
);
username_notify.parent()
.removeClass('register-success')
.addClass('register-danger');
username_notify.show();
});
validationError = true;
}

callback();
});
}
}


function validatePassword(password, password_confirm) {
const password_notify = $('#password-notify');
const password_confirm_notify = $('#password-confirm-notify');
Expand Down
Loading