I've tried to be clever about this many times, and it always ends up in a huge mess. So instead of trying to detect the exact issue, I will rather just tell the user what needs to be done:
% if (validation->has_error('username') {
<p class="help"><%=l 'You need to fill in a username, which needs to be...' %></p>
% }
The "<%=l' part is the same as <%= l('you need to...') %>, I just like to write it a "funny" way. The l() helper needs to do the actual translation for you, as you would with any other string in your application.