Package play.i18n
Interface Messages
- All Superinterfaces:
play.api.i18n.MessagesProvider
- All Known Implementing Classes:
MessagesImpl
public interface Messages
extends play.api.i18n.MessagesProvider
A Messages will produce messages using a specific language.
This interface that is typically backed by MessagesImpl, but does not return MessagesApi.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault StringGet the message at the given key.default StringGet the message at the first defined key.play.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.default play.api.i18n.Messagesmessages()
-
Method Details
-
lang
Lang lang()Get the lang for these messages.- Returns:
- the chosen language
-
apply
Get the message at the given key.Uses `java.text.MessageFormat` internally to format the message.
- Parameters:
key- the message keyargs- the message arguments- Returns:
- the formatted message or a default rendering if the key wasn't defined
-
apply
Get the message at the first defined key.Uses `java.text.MessageFormat` internally to format the message.
- Parameters:
keys- the messages keysargs- the message arguments- Returns:
- the formatted message or a default rendering if the key wasn't defined
-
at
Get the message at the given key.Uses `java.text.MessageFormat` internally to format the message.
- Parameters:
key- the message keyargs- the message arguments- Returns:
- the formatted message or a default rendering if the key wasn't defined
-
at
Get the message at the first defined key.Uses `java.text.MessageFormat` internally to format the message.
- Parameters:
keys- the messages keysargs- the message arguments- Returns:
- the formatted message or a default rendering if the key wasn't defined
-
isDefinedAt
Check if a message key is defined.- Parameters:
key- the message key- Returns:
- a Boolean
-
asScala
play.api.i18n.Messages asScala() -
messages
default play.api.i18n.Messages messages()- Specified by:
messagesin interfaceplay.api.i18n.MessagesProvider
-