Package play.i18n
Interface Messages
-
- All Superinterfaces:
play.api.i18n.MessagesProvider
- All Known Implementing Classes:
MessagesImpl
public interface Messages extends play.api.i18n.MessagesProviderA 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 Modifier and Type Interface Description static classMessages.Attrs
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Stringapply(String key, Object... args)Get the message at the given key.default Stringapply(List<String> keys, Object... args)Get the message at the first defined key.play.api.i18n.MessagesasScala()Stringat(String key, Object... args)Get the message at the given key.Stringat(List<String> keys, Object... args)Get the message at the first defined key.BooleanisDefinedAt(String key)Check if a message key is defined.Langlang()Get the lang for these messages.default play.api.i18n.Messagesmessages()
-
-
-
Method Detail
-
lang
Lang lang()
Get the lang for these messages.- Returns:
- the chosen language
-
apply
default String apply(String key, Object... args)
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
default String apply(List<String> keys, Object... args)
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
String at(String key, Object... args)
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
String at(List<String> keys, Object... args)
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
Boolean isDefinedAt(String key)
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
-
-