play.i18n
Class Messages

java.lang.Object
  extended by play.i18n.Messages

public class Messages
extends java.lang.Object

High-level internationalisation API.


Constructor Summary
Messages()
           
 
Method Summary
static java.lang.String get(play.api.i18n.Lang lang, java.lang.String key, java.lang.Object... args)
          Translates a message.
static java.lang.String get(java.lang.String key, java.lang.Object... args)
          Translates a message.
static java.lang.Boolean isDefined(play.api.i18n.Lang lang, java.lang.String key)
          Check if a message key is defined.
static java.lang.Boolean isDefined(java.lang.String key)
          Check if a message key is defined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Messages

public Messages()
Method Detail

get

public static java.lang.String get(play.api.i18n.Lang lang,
                                   java.lang.String key,
                                   java.lang.Object... args)
Translates a message. Uses `java.text.MessageFormat` internally to format the message.

Parameters:
lang - the message lang
key - the message key
args - the message arguments
Returns:
the formatted message or a default rendering if the key wasn't defined

get

public static java.lang.String get(java.lang.String key,
                                   java.lang.Object... args)
Translates a message. Uses `java.text.MessageFormat` internally to format the message.

Parameters:
key - the message key
args - the message arguments
Returns:
the formatted message or a default rendering if the key wasn't defined

isDefined

public static java.lang.Boolean isDefined(play.api.i18n.Lang lang,
                                          java.lang.String key)
Check if a message key is defined.

Parameters:
lang - the message lang
key - the message key
Returns:
a Boolean

isDefined

public static java.lang.Boolean isDefined(java.lang.String key)
Check if a message key is defined.

Parameters:
key - the message key
Returns:
a Boolean