我想翻译由views.html.helpers._
输入生成的标记的默认约束和错误消息。我在文档中找不到它,并且已经开始浏览代码,但如果有人比我快,请回答并获得奖励。对于现场信息和错误,i18n消息ID是什么?
下面是示例模板代码:
@inputText(regForm("Login"), 'id-> "username", 'placeholder -> "Login", 'required -> "yes", 'autofocus -> "yes")
这里是生成的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>
我想翻译出现在最后两个跨度文本。
编辑: 我已经知道翻译是如何工作的from the documentation。没有说明的是,在没有满足字段约束的情况下显示的消息(错误消息)和一般信息的默认消息ID。
好吧,好的:我的错。只阅读你回答的问题是正确的。但是我特意询问了消息ID,并且我找到了它。看到我的答案。 – Rajish