|
||||||||||
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 request, but if you can't the getMessages method will handle it properly. The get() methods are easy to use.
Field Summary | |
---|---|
static String |
DEFAULT_BASENAME
Use this basename if no other is provided. |
static String |
FALLBACK_LOCALE
Use this locale if no other provided. |
static String |
FALLBACK_NODEDATA
The name of the property to store the current system language. |
static String |
I18N_CONFIG_PATH
The node name where the configuration for i18n is stored. |
static String |
LANGUAGES_NODE_NAME
Under this node all the available languages are stored. |
Constructor Summary | |
---|---|
MessagesManager()
|
Method Summary | |
---|---|
static String |
get(String key)
|
static String |
get(String key,
Object[] args)
Get a message with parameters inside: the value {0} must be a number. |
abstract Collection |
getAvailableLocales()
|
abstract Locale |
getDefaultLocale()
|
static MessagesManager |
getInstance()
Deprecated. since 4.5, use IoC ! |
static Messages |
getMessages()
|
static Messages |
getMessages(Locale locale)
|
static Messages |
getMessages(String basename)
|
static Messages |
getMessages(String basename,
Locale locale)
|
protected abstract Messages |
getMessagesInternal(String basename,
Locale locale)
|
static String |
getWithDefault(String key,
Object[] args,
String defaultMsg)
Get a message with parameters inside: the value {0} must be a number. |
static String |
getWithDefault(String key,
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 String FALLBACK_LOCALE
public static final String DEFAULT_BASENAME
public static final String I18N_CONFIG_PATH
public static final String FALLBACK_NODEDATA
public static final String LANGUAGES_NODE_NAME
Constructor Detail |
---|
public MessagesManager()
Method Detail |
---|
public static MessagesManager getInstance()
public static Messages getMessages()
public static Messages getMessages(String basename)
public static Messages getMessages(Locale locale)
public static Messages getMessages(String basename, Locale locale)
public static String get(String key)
public static String get(String key, Object[] args)
key
- key to findargs
- replacement strings
public static String getWithDefault(String key, String defaultMsg)
key
- key to finddefaultMsg
- default message
public static String getWithDefault(String key, Object[] args, String defaultMsg)
key
- key to findargs
- replacement stringsdefaultMsg
- default message
public abstract void init()
public abstract Collection getAvailableLocales()
public abstract Locale getDefaultLocale()
protected abstract Messages getMessagesInternal(String basename, Locale locale)
public abstract void reload()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |