Messages

org.scalatra.i18n.Messages
See theMessages companion object
class Messages(locale: Locale, bundlePath: String)

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def apply(key: String): String
def apply(key: String, default: String): String

Returned the value for the key or the default

Returned the value for the key or the default

Attributes

def get(key: String): Option[String]

Null-safe implementation is preferred by using Option. The caller can support default value by using getOrElse: messages.get("hello").getOrElse("world")

Null-safe implementation is preferred by using Option. The caller can support default value by using getOrElse: messages.get("hello").getOrElse("world")

The return value can also be used with format: messages.get("hello %d").map(_.format(5))

To return the string itself: messages("hello")

Value parameters

key

The key to find the message for

Attributes

def getOrElse(key: String, default: => String): String

Return the value for the key or fall back to the provided default

Return the value for the key or fall back to the provided default

Attributes