cristian.vrabie(a)xwiki.com wrote:
Hi Jain, (hope this is your first name :) )
$msg is a instance of xwiki messaging tool.
(swiki-core\src\main\java\com\xpn\xwiki\web\XWikiMessageTool.java)
it is mostly used to get translations for a certain translation key.
translations are kept in bundles in specific documents like this:
translationkey1=My english version of this
translation_key_2=My text here
You can add a document as translation document by going in xwiki
administration /bin/admin/XWiki/XWikiPreferences > Preferences > Advanced
section > Internationalization Document Bundles and adding the fullnames
of the documents that want to act as translation pages. Like:
MySpace.Translations
But the main resource files are located in
xwiki-core/src/main/resources/ApplicationResources*.properties (in the
source) and in xwiki-core-*.jar#ApplicationResources*.properties (the
target jar).
After you add your document here, you can do wherever
you want
$msg.get("translation_key_2") or more simple ${msg.translation_key_2} and
you text will render. To add another language just translate your
translation document in the desired language (use the "Translate this
document into" link).
> Guillaume,
>
> You said that $msg.get("translation") would render a message.
> But, how do I know what are the otehr strings (like "translation") that I
> can use to render appropriate messages. Is there a lsit of these somewhere
> in the code or on xwiki.org?
>
> Thanks
>
>