|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.i18n.MessagesManager
public abstract class MessagesManager
From this class you get the i18n messages. You should pass a a request, but if you can't the getMessages method will handle it properly. The get() methods are easy to use.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_BASENAME
Use this basename if no other is provided. |
static java.lang.String |
FALLBACK_LOCALE
Use this locale if no other provided. |
static java.lang.String |
FALLBACK_NODEDATA
The name of the property to store the current system language. |
static java.lang.String |
I18N_CONFIG_PATH
The node name where the configuration for i18n is stored. |
static java.lang.String |
LANGUAGES_NODE_NAME
Under this node all the available languages are stored. |
Constructor Summary | |
---|---|
MessagesManager()
|
Method Summary | |
---|---|
static java.lang.String |
get(java.lang.String key)
|
static java.lang.String |
get(java.lang.String key,
java.lang.Object[] args)
Get a message with parameters inside: the value {0} must be a number. |
abstract java.util.Collection |
getAvailableLocales()
|
abstract java.util.Locale |
getDefaultLocale()
|
static MessagesManager |
getInstance()
|
static Messages |
getMessages()
|
static Messages |
getMessages(java.util.Locale locale)
|
static Messages |
getMessages(java.lang.String basename)
|
static Messages |
getMessages(java.lang.String basename,
java.util.Locale locale)
|
protected abstract Messages |
getMessagesInternal(java.lang.String basename,
java.util.Locale locale)
|
static java.lang.String |
getWithDefault(java.lang.String key,
java.lang.Object[] args,
java.lang.String defaultMsg)
Get a message with parameters inside: the value {0} must be a number. |
static java.lang.String |
getWithDefault(java.lang.String key,
java.lang.String defaultMsg)
Use a default string. |
abstract void |
init()
|
abstract void |
reload()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FALLBACK_LOCALE
public static final java.lang.String DEFAULT_BASENAME
public static final java.lang.String I18N_CONFIG_PATH
public static final java.lang.String FALLBACK_NODEDATA
public static final java.lang.String LANGUAGES_NODE_NAME
Constructor Detail |
---|
public MessagesManager()
Method Detail |
---|
public static MessagesManager getInstance()
public static Messages getMessages()
public static Messages getMessages(java.lang.String basename)
public static Messages getMessages(java.util.Locale locale)
public static Messages getMessages(java.lang.String basename, java.util.Locale locale)
public static java.lang.String get(java.lang.String key)
public static java.lang.String get(java.lang.String key, java.lang.Object[] args)
key
- key to findargs
- replacement strings
public static java.lang.String getWithDefault(java.lang.String key, java.lang.String defaultMsg)
key
- key to finddefaultMsg
- default message
public static java.lang.String getWithDefault(java.lang.String key, java.lang.Object[] args, java.lang.String defaultMsg)
key
- key to findargs
- replacement stringsdefaultMsg
- default message
public abstract void init()
public abstract java.util.Collection getAvailableLocales()
public abstract java.util.Locale getDefaultLocale()
protected abstract Messages getMessagesInternal(java.lang.String basename, java.util.Locale locale)
public abstract void reload()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |