Package play.i18n
Class MessagesImpl
java.lang.Object
play.i18n.MessagesImpl
- All Implemented Interfaces:
play.api.i18n.MessagesProvider,Messages
This class implements the Messages interface.
This class serves two purposes. One is for backwards compatibility, it serves the old static API for accessing messages. The other is a new API, which carries an inject messages, and a selected language.
The methods for looking up messages on the old API are called get, on the new API, they are called at. In Play 3.0, when we remove the old API, we may alias the at methods to the get names.
-
Nested Class Summary
Nested classes/interfaces inherited from interface play.i18n.Messages
Messages.Attrs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionplay.api.i18n.MessagesasScala()Get the message at the given key.Get the message at the first defined key.isDefinedAt(String key) Check if a message key is defined.lang()Get the lang for these messages.
-
Constructor Details
-
MessagesImpl
-
-
Method Details
-
lang
Description copied from interface:MessagesGet the lang for these messages. -
messagesApi
- Returns:
- The underlying API
-
at
Get the message at the given key.Uses `java.text.MessageFormat` internally to format the message.
-
at
Get the message at the first defined key.Uses `java.text.MessageFormat` internally to format the message.
-
isDefinedAt
Check if a message key is defined.- Specified by:
isDefinedAtin interfaceMessages- Parameters:
key- the message key- Returns:
- a Boolean
-
asScala
public play.api.i18n.Messages asScala()
-