com.xpn.xwiki.plugin.applicationmanager.core.plugin
Class XWikiPluginMessageTool
java.lang.Object
com.xpn.xwiki.web.XWikiMessageTool
com.xpn.xwiki.plugin.applicationmanager.core.plugin.XWikiPluginMessageTool
- Direct Known Subclasses:
- ApplicationManagerMessageTool
public class XWikiPluginMessageTool
- extends XWikiMessageTool
Plugin internationalization service based XWikiMessageTool.
- Version:
- $Id: 8a8ecb1020ef91df8ceff73568654667cae3bab3 $
|
Method Summary |
String |
get(String key,
String param)
Find a translation and then replace any parameters found in the translation by the passed param parameter. |
String |
get(String key,
String[] params)
Find a translation and then replace any parameters found in the translation by the passed params parameters. |
protected String |
getTranslation(String key)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XWikiPluginMessageTool
public XWikiPluginMessageTool(Locale locale,
XWikiPluginInterface plugin,
XWikiContext context)
- Parameters:
locale - the locale.plugin - the plugin.context - the XWikiContext object, used to get access to XWiki primitives for loading
documents
XWikiPluginMessageTool
public XWikiPluginMessageTool(ResourceBundle bundle)
- Parameters:
bundle - the default Resource Bundle to fall back to if no document bundle is found when trying to get a key
XWikiPluginMessageTool
public XWikiPluginMessageTool(ResourceBundle bundle,
XWikiContext context)
- Parameters:
bundle - the default Resource Bundle to fall back to if no document bundle is found when trying to get a keycontext - the XWikiContext object, used to get access to XWiki primitives for loading
documents
getTranslation
protected String getTranslation(String key)
-
Start calling context's XWikiMessageTool.get(String) then if nothing is found use
plugin's ResourceBundle.
- Overrides:
getTranslation in class XWikiMessageTool
- See Also:
XWikiMessageTool.getTranslation(java.lang.String)
get
public String get(String key,
String[] params)
- Find a translation and then replace any parameters found in the translation by the passed params parameters. The
format is the one used by
MessageFormat.
- Parameters:
key - the key of the string to findparams - the array of parameters to use for replacing "{N}" elements in the string. See
MessageFormat for the full syntax
- Returns:
- the translated string with parameters resolved
- See Also:
XWikiMessageTool.get(String, List)
get
public String get(String key,
String param)
- Find a translation and then replace any parameters found in the translation by the passed param parameter. The
format is the one used by
MessageFormat.
- Parameters:
key - the key of the string to findparam - the parameter to use for replacing "{0}" element in the string. See MessageFormat
for the full syntax
- Returns:
- the translated string with parameters resolved
- See Also:
XWikiMessageTool.get(String, List)
Copyright © 2004-2013 XWiki. All Rights Reserved.