@Singleton
public class MessagesApi
extends java.lang.Object
Constructor and Description |
---|
MessagesApi(play.api.i18n.MessagesApi messages) |
Modifier and Type | Method and Description |
---|---|
play.api.i18n.MessagesApi |
asScala() |
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.
|
boolean |
langCookieHttpOnly() |
java.lang.String |
langCookieName() |
boolean |
langCookieSecure() |
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 request.
|
public play.api.i18n.MessagesApi asScala()
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)
candidates
- the candidate languagespublic Messages preferred(Http.RequestHeader request)
request
- the incoming requestpublic java.lang.String langCookieName()
public boolean langCookieSecure()
public boolean langCookieHttpOnly()