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

Add a velocity helper for the very common use case of a wiki translation macro call with a script parameter

    XMLWordPrintable

Details

    • Unit
    • Unknown

    Description

      XWIKI-24290 added the possibility to pass directly a script variable to a translation macro, which makes a lot easier to use user input safely:

      {{velocity}}
      #set ($txparameters = [$userinput, 42])
      {{translation key="some.translation" scriptParameters="txparameters"/}}
      {{/velocity}}
      

      But it's a very common use case and a Velocity helper could help make these calls more readable and mitigate the risk of using the same variable for two different calls:

      {{velocity}}
      #wikiTranslation('some.translation',  [$userinput, 42])
      {{/velocity}}
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: