Hello, Wasca!
Im having same problem, and I guess I’ve found a way to change any of those messages. I think it’s not the right way I do it, but it works for me well =)
You won’t need to modify WP core files, but you will need to edit one of the plugin’s PHP files – it’s called login-with-ajax.php.
This file is located right inside login-with-ajax plugin folder.
So basically, the idea is to catch up error messages and replace them with your custom ones. All messages are handled through the WP native class WP Error.
Read up some usefull info, using this link above. When you’re done, you will then understand, that login-with-ajax plugin sends our post data (all that user fills into input fields during registration or login) and then receives answer, containing an error, if there is one.
So now, look up into our login-with-ajax.php file and find line 195 and 226. It’s those one lines, where an error result returns:
$return['error'] = $loginResult->get_error_message(); // For Login fields
$return['error'] = $errors->get_error_message(); // For registration fields
Since plugin uses get_error_message() function, and we’re already having some translation files, this error message will return already translated. So, we need to receive some other data to work with. Reading up class reference about WP error once again, you can find some other function called get_error_code(). So, let’s replace get_error_message() with get_error_code() and see what happens on the site:
$return['error'] = $loginResult->get_error_code();
$return['error'] = $errors->get_error_code();
You will now be able to see error codes instead of real human-readable error messages. Now, you can str_replace this error codes with some custom stuff. To do so, add these line after your modified 195 and 226 lines:
$return['error'] = str_replace('empty_username', 'Oh my, you have no name, sir?', $return['error']);
This example will replace an error message if the registration form’s username is empty. You can check up all the other error codes by your own and str_replace them your own way ??
Cheers.