play.api.i18n.I18nSupport
See theI18nSupport companion object
Brings convenient implicit conversions from play.api.mvc.RequestHeader to Messages.
Example:
import play.api.i18n.Messages
class MyController(val messagesApi: MessagesApi ...)
extends AbstractController(cc) with I18nSupport {
val action = Action { implicit request =>
val messageFromRequest = request.messages("hello.world")
Ok(s"$messageFromRequest")
}
}
Attributes
-
Companion
-
object
-
Graph
-
-
Supertypes
-
class Object
trait Matchable
class Any
Members list
Adds convenient methods to handle the messages.
Adds convenient methods to handle the messages.
Attributes
-
Inherited from:
-
I18NSupportLowPriorityImplicits
-
Supertypes
-
class Object
trait Matchable
class Any
Adds convenient methods to handle the client-side language
Adds convenient methods to handle the client-side language
Attributes
-
Inherited from:
-
I18NSupportLowPriorityImplicits
-
Supertypes
-
class Object
trait Matchable
class Any
Converts from a request directly into a Messages.
Converts from a request directly into a Messages.
Value parameters
-
request
-
the incoming request
Attributes
-
Returns
-
The preferred Messages according to the given play.api.mvc.RequestHeader
Adds convenient methods to handle the messages.
Adds convenient methods to handle the client-side language