Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-187

Accessing the XWikiMessageTool from Groovy

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Trivial
    • 1.0 B1
    • 0.9.840
    • Groovy
    • None
    • i18n

    Description

      Currently the XWikiMessageTool utility cannot be accessed from Groovy scripts, only from Velocity's. Can i add the code below to XWikiGroovyRenderer.prepareContext?

      ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources", new Locale(language));
      if (bundle == null)
      bundle = ResourceBundle.getBundle("ApplicationResources");
      XWikiMessageTool msg = new XWikiMessageTool(bundle);
      context.put("msg", msg);

      Attachments

        Activity

          People

            slauriere slauriere
            slauriere slauriere
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: