I’d like to translate the default constraints and error messages for markup generated by the views.html.helpers._ inputs. I couldn’t find it in the documentation, and have already started browsing the code, but if anyone is faster than me please answer and be awarded.
Here is the sample template code:
@inputText(regForm("Login"), 'id-> "username", 'placeholder -> "Login", 'required -> "yes", 'autofocus -> "yes")
And here is the generated HTML:
<div id="username_field" class="error clearfix">
<div class="input">
<input type="text" id="username" name="Login" value="" id="username" placeholder="Login" required="yes" autofocus="yes">
<span class="help-inline">This field is required</span>
<span class="help-block">Required</span>
</div>
I’d like to translate the texts appearing in the two last spans.
Edit:
I already know how the translation works from the documentation. What is not stated there are the default message IDs for the messages shown where a field constraint isn’t fulfilled (the error messages) and for general info.
You have to override labels from the source messages file in your own
messages.xyfiles.Also take a look at the other answer some time ago there was a problem if file for default language hasn’t the lang extension. AFAIK it was fixed after that answer, however it would be cool if you’ll check it and confirm the current state in the comment.