|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.web.XWikiMessageTool
LocalizationManager
component instead
@Deprecated public class XWikiMessageTool
Internationalization service based on key/property values. The key is the id of the message being looked for and the returned value is the message in the language requested. There are 3 sources where properties are looked for (in the specified order):
Field Summary | |
---|---|
protected ResourceBundle |
bundle
Deprecated. The default Resource Bundle to fall back to if no document bundle is found when trying to get a key. |
protected XWikiContext |
context
Deprecated. |
Constructor Summary | |
---|---|
XWikiMessageTool(ContextualLocalizationManager localization)
Deprecated. |
|
XWikiMessageTool(ResourceBundle bundle,
XWikiContext context)
Deprecated. |
Method Summary | |
---|---|
String |
get(String key)
Deprecated. |
String |
get(String key,
List<?> params)
Deprecated. Find a translation and then replace any parameters found in the translation by the passed params parameters. |
String |
get(String key,
Object... params)
Deprecated. Find a translation and then replace any parameters found in the translation by the passed parameters. |
XWikiDocument |
getDocumentBundle(String documentName)
Deprecated. Helper method to help get a translated version of a document. |
protected List<String> |
getDocumentBundleNames()
Deprecated. |
Properties |
getDocumentBundleProperties(XWikiDocument docBundle)
Deprecated. |
List<XWikiDocument> |
getDocumentBundles()
Deprecated. |
List<XWikiDocument> |
getDocumentBundles(String documentName,
String defaultLanguage)
Deprecated. Helper method to help get a translated version of a document. |
protected String |
getTranslation(String key)
Deprecated. Looks for a translation in the list of internationalization document bundles. |
protected XWikiContext |
getXWikiContext()
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ResourceBundle bundle
@Deprecated protected XWikiContext context
XWikiContext
object, used to get access to XWiki primitives for loading documents.
Constructor Detail |
---|
public XWikiMessageTool(ContextualLocalizationManager localization)
localization
- the localization managercomponentManager
- used to get the proper renderercontext
- the XWiki contextpublic XWikiMessageTool(ResourceBundle bundle, XWikiContext context)
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
documentsMethod Detail |
---|
protected XWikiContext getXWikiContext()
public String get(String key)
key
- the key identifying the message to look for
get(String, java.util.List)
for more details on the algorithm used to find the message
public String get(String key, List<?> params)
MessageFormat
.
Note: The reason we're using a List instead of an Object array is because we haven't found how to easily create
an Array in Velocity whereas a List is easily created. For example: $msg.get("key", ["1", "2", "3"])
.
key
- the key of the string to findparams
- the list of parameters to use for replacing "{N}" elements in the string. See
MessageFormat
for the full syntax
public String get(String key, Object... params)
MessageFormat
.
key
- the key of the string to findparams
- the list of parameters to use for replacing "{N}" elements in the string. See
MessageFormat
for the full syntax
protected List<String> getDocumentBundleNames()
for more details on the algorithm used to find the document bundles
public List<XWikiDocument> getDocumentBundles()
for more details on the algorithm used to find the document bundles
public XWikiDocument getDocumentBundle(String documentName)
documentName
- the document's name (eg Space.Document)
public List<XWikiDocument> getDocumentBundles(String documentName, String defaultLanguage)
documentName
- the document's name (eg Space.Document)defaultLanguage
- default language
public Properties getDocumentBundleProperties(XWikiDocument docBundle)
docBundle
- the document bundle.
protected String getTranslation(String key)
key
- the key identifying the translation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |