RequestWithMessagesApi

play.api.i18n.I18NSupportLowPriorityImplicits.RequestWithMessagesApi
implicit class RequestWithMessagesApi(request: RequestHeader)

Adds convenient methods to handle the messages.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def lang(implicit messagesApi: MessagesApi): Lang

Adds a lang method that can be used on a request, returning the lang corresponding to the preferred language of the request.

Adds a lang method that can be used on a request, returning the lang corresponding to the preferred language of the request.

For example:

 implicit val messagesApi: MessagesApi = ...
 val lang: Lang = request.lang

Attributes

def messages(implicit messagesApi: MessagesApi): Messages

Adds a messages method that can be used on a request, returning the Messages object in the preferred language of the request.

Adds a messages method that can be used on a request, returning the Messages object in the preferred language of the request.

For example:

 implicit val messagesApi: MessagesApi = ...
 val messageFromRequest: Messages = request.messages("hello.world")

Attributes