MessagesImpl

play.api.i18n.MessagesImpl
case class MessagesImpl(lang: Lang, messagesApi: MessagesApi) extends Messages

Provides messages for a particular language.

This intended for use to carry both the messages and the current language, particularly useful in templates so that both can be captured by one parameter.

Value parameters

lang

The lang (context)

messagesApi

The messages API

Attributes

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

Members list

Value members

Concrete methods

override def apply(key: String, args: Any*): 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

Definition Classes
override def apply(keys: Seq[String], args: Any*): 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

Definition Classes
override def asJava: Messages

Attributes

Returns

the Java version for this Messages.

Definition Classes
override def isDefinedAt(key: String): 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

Definition Classes
override def translate(key: String, args: Seq[Any]): Option[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, if this key was defined

Definition Classes

Inherited methods

Every Messages is also a MessagesProvider.

Every Messages is also a MessagesProvider.

Attributes

Returns

the messages itself.

Inherited from:
Messages

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product