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

Accessing the XWikiMessageTool from Groovy

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 0.9.840
    • Fix Version/s: 1.0 B1
    • Component/s: Groovy
    • Labels:
      None
    • keywords:
      i18n
    • Similar issues:

      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

            • Assignee:
              slauriere slauriere
              Reporter:
              slauriere slauriere
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: