1
twirlテンプレートで国際化を使用しようとしています。私はこのガイドに従った:https://stackoverflow.com/a/30800825/1567737暗黙twirlパラメータ:指定されていない値パラメータメッセージ
私はimplicit messages: Messages
に問題があります。
import javax.inject.Inject
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, Controller}
class TestController @Inject()(val messagesApi: MessagesApi)
extends Controller with I18nSupport {
def index = Action {
Ok(views.html.test.render())
}
}
test.scala.html
@()(implicit messages: Messages)
私も私のbuild.sbtにroutesGenerator := InjectedRoutesGenerator
を追加しました:私は、エラーが発生した最低限に私のセットアップが低下しています。
これは、上記のリンク先のドキュメントとガイドに従って十分なはずです。
[error] app/controllers/TestController.scala:11: not enough arguments for method render: (messages: play.api.i18n.Messages)play.twirl.api.HtmlFormat.Appendable.
[error] Unspecified value parameter messages.
[error] Ok(views.html.test.render())
- プレイバージョン:2.5.9
- SBTバージョン:それでも私は、次のコンパイル時にエラーが発生します0.13.11
- Scalaのバージョン:2.11.7