class DefaultMessagesApi extends MessagesApi
- Alphabetic
- By Inheritance
- DefaultMessagesApi
- MessagesApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new DefaultMessagesApi(messages: Map[String, Map[String, String]])
- new DefaultMessagesApi(javaMessages: Map[String, Map[String, String]], langs: i18n.Langs)
-
new
DefaultMessagesApi(messages: Map[String, Map[String, String]] = Map.empty, langs: Langs = new DefaultLangs(), langCookieName: String = "PLAY_LANG", langCookieSecure: Boolean = false, langCookieHttpOnly: Boolean = false, langCookieSameSite: Option[SameSite] = None, httpConfiguration: HttpConfiguration = HttpConfiguration(), langCookieMaxAge: Option[Int] = None)
- Annotations
- @Inject()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(keys: Seq[String], args: Any*)(implicit lang: Lang): String
Translates the first defined message.
Translates the first defined message.
Uses
java.text.MessageFormat
internally to format the message.- keys
the message key
- args
the message arguments
- returns
the formatted message or a default rendering if the key wasn’t defined
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
def
apply(key: String, args: Any*)(implicit lang: Lang): String
Translates a message.
Translates a message.
Uses
java.text.MessageFormat
internally to format the message.- key
the message key
- args
the message arguments
- returns
the formatted message or a default rendering if the key wasn’t defined
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asJava: i18n.MessagesApi
- returns
The Java version for Messages API.
- Definition Classes
- MessagesApi
-
def
clearLang(result: Result): Result
Given a Result, return a new Result with the lang cookie discarded.
Given a Result, return a new Result with the lang cookie discarded.
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val httpConfiguration: HttpConfiguration
-
def
isDefinedAt(key: String)(implicit lang: Lang): Boolean
Check if a message key is defined.
Check if a message key is defined.
- key
the message key
- returns
a boolean
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
langCookieHttpOnly: Boolean
Whether the HTTP only attribute of the cookie should be set to true or not.
Whether the HTTP only attribute of the cookie should be set to true or not.
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
val
langCookieMaxAge: Option[Int]
An optional max age in seconds for the language Cookie.
An optional max age in seconds for the language Cookie.
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
val
langCookieName: String
Name for the language Cookie.
Name for the language Cookie.
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
val
langCookieSameSite: Option[SameSite]
The value of the SameSite attribute of the cookie.
The value of the SameSite attribute of the cookie. If None, then no SameSite attribute is set.
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
val
langCookieSecure: Boolean
Whether the secure attribute of the cookie is true or not.
Whether the secure attribute of the cookie is true or not.
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
val
messages: Map[String, Map[String, String]]
Get all the defined messages
Get all the defined messages
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
noMatch(key: String, args: Seq[Any])(implicit lang: Lang): String
- Attributes
- protected
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
preferred(request: RequestHeader): Messages
Get the preferred messages for the given request
Get the preferred messages for the given request
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
def
preferred(request: RequestHeader): Messages
Get the preferred messages for the given Java request
Get the preferred messages for the given Java request
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
def
preferred(candidates: Seq[Lang]): Messages
Get the preferred messages for the given candidates.
Get the preferred messages for the given candidates.
Will select a language from the candidates, based on the languages available, and fallback to the default language if none of the candidates are available.
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
def
setLang(result: Result, lang: Lang): Result
Given a Result and a Lang, return a new Result with the lang cookie set to the given Lang.
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
translate(key: String, args: Seq[Any])(implicit lang: Lang): Option[String]
Translates a message.
Translates a message.
Uses
java.text.MessageFormat
internally to format the message.- key
the message key
- args
the message arguments
- returns
the formatted message, if this key was defined
- Definition Classes
- DefaultMessagesApi → MessagesApi
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()