trait MessagesApi extends AnyRef
- Alphabetic
- By Inheritance
- MessagesApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
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
-
abstract
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
-
abstract
def
clearLang(result: Result): Result
Given a Result, return a new Result with the lang cookie discarded.
-
abstract
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
- abstract def langCookieHttpOnly: Boolean
- abstract def langCookieName: String
- abstract def langCookieSameSite: Option[SameSite]
- abstract def langCookieSecure: Boolean
-
abstract
def
messages: Map[String, Map[String, String]]
Get all the defined messages
-
abstract
def
preferred(request: RequestHeader): Messages
Get the preferred messages for the given Java request
-
abstract
def
preferred(request: RequestHeader): Messages
Get the preferred messages for the given request
-
abstract
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.
-
abstract
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.
-
abstract
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
Concrete 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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asJava: i18n.MessagesApi
- returns
The Java version for Messages API.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.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()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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
- @native() @throws( ... )