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 Modifier and Type Interface Description static class
Messages.Attrs
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default String
apply(String key, Object... args)
Get the message at the given key.default String
apply(List<String> keys, Object... args)
Get the message at the first defined key.play.api.i18n.Messages
asScala()
String
at(String key, Object... args)
Get the message at the given key.String
at(List<String> keys, Object... args)
Get the message at the first defined key.Boolean
isDefinedAt(String key)
Check if a message key is defined.Lang
lang()
Get the lang for these messages.default play.api.i18n.Messages
messages()
-
-
-
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:
messages
in interfaceplay.api.i18n.MessagesProvider
-
-