scala - Implicit twirl parameter: Unspecified value parameter messages -


i trying use internationalization in twirl templates. followed guide: https://stackoverflow.com/a/30800825/1567737

i having issues implicit messages: messages. have reduced setup bare minimum on error occurs:

testcontroller
import javax.inject.inject import play.api.i18n.{i18nsupport, messagesapi} import play.api.mvc.{action, controller}  class testcontroller @inject()(val messagesapi: messagesapi)      extends controller i18nsupport {    def index = action {     ok(views.html.test.render())   }  } 
test.scala.html
@()(implicit messages: messages) 

i have added routesgenerator := injectedroutesgenerator build.sbt.

this should sufficient according docs , guide linked above. still following compile time error:

[error] app/controllers/testcontroller.scala:11: not enough arguments method render: (messages: play.api.i18n.messages)play.twirl.api.htmlformat.appendable. [error] unspecified value parameter messages. [error]     ok(views.html.test.render()) 
  • play version: 2.5.9
  • sbt version: 0.13.11
  • scala version: 2.11.7

well, apparently implicit parameters work on apply method. , not when explicitly call render.

ok(views.html.test.render())

must be

ok(views.html.test())


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -