@Singleton
public class MessagesApi
extends java.lang.Object
Constructor and Description |
---|
MessagesApi(play.api.i18n.MessagesApi messages) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
get(play.api.i18n.Lang lang,
java.util.List<java.lang.String> keys,
java.lang.Object... args)
Translates the first defined message.
|
java.lang.String |
get(play.api.i18n.Lang lang,
java.lang.String key,
java.lang.Object... args)
Translates a message.
|
java.lang.Boolean |
isDefinedAt(play.api.i18n.Lang lang,
java.lang.String key)
Check if a message key is defined.
|
Messages |
preferred(java.util.Collection<Lang> candidates)
Get a messages context appropriate for the given candidates.
|
Messages |
preferred(Http.RequestHeader request)
Get a messages context appropriate for the given candidates.
|
play.api.i18n.MessagesApi |
scalaApi() |
public play.api.i18n.MessagesApi scalaApi()
public java.lang.String get(play.api.i18n.Lang lang, java.lang.String key, java.lang.Object... args)
lang
- the message langkey
- the message keyargs
- the message argumentspublic java.lang.String get(play.api.i18n.Lang lang, java.util.List<java.lang.String> keys, java.lang.Object... args)
lang
- the message langkeys
- the messages keysargs
- the message argumentspublic java.lang.Boolean isDefinedAt(play.api.i18n.Lang lang, java.lang.String key)
lang
- the message langkey
- the message keypublic Messages preferred(java.util.Collection<Lang> candidates)
public Messages preferred(Http.RequestHeader request)