Messages

play.api.i18n.Messages
See theMessages companion trait
object Messages extends MessagesImplicits

Internationalisation API.

For example:

val msgString = Messages("items.found", items.size)

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Messages.type

Members list

Type members

Classlikes

object Attrs

Request Attributes for the MessagesApi Currently all Attributes are only available inside the MessagesApi methods.

Request Attributes for the MessagesApi Currently all Attributes are only available inside the MessagesApi methods.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Attrs.type

A source for messages

A source for messages

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class UrlMessageSource(url: URL) extends MessageSource

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def apply(key: String, args: Any*)(implicit provider: MessagesProvider): String

Translates a message.

Translates a message.

Uses java.text.MessageFormat internally to format the message.

Value parameters

args

the message arguments

key

the message key

Attributes

Returns

the formatted message or a default rendering if the key wasn’t defined

def apply(keys: Seq[String], args: Any*)(implicit provider: MessagesProvider): String

Translates the first defined message.

Translates the first defined message.

Uses java.text.MessageFormat internally to format the message.

Value parameters

args

the message arguments

keys

the message key

Attributes

Returns

the formatted message or a default rendering if the key wasn’t defined

def isDefinedAt(key: String)(implicit provider: MessagesProvider): Boolean

Check if a message key is defined.

Check if a message key is defined.

Value parameters

key

the message key

Attributes

Returns

a boolean

def parse(messageSource: MessageSource, messageSourceName: String): Either[ExceptionSource, Map[String, String]]

Parse all messages of a given input.

Parse all messages of a given input.

Attributes

Implicits

Inherited implicits

implicit def implicitMessagesProviderToMessages(implicit messagesProvider: MessagesProvider): Messages

Attributes

Inherited from:
MessagesImplicits