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

Single quotes in a translated message containing parameters disappear.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 10.7
    • Fix Version/s: None
    • Component/s: Localization
    • Labels:
      None
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      Steps to reproduce

      • Create a translation bundle with the following translation key and message: 
        translation.key=Parameter: {0}. Sentence with some 'single quotes' and "double quotes".
      • Create a page containing the following Velocity script:
        {{velocity}}
        #set($date = $datetool.format("d MMMM yyyy", $doc.creationDate))
        $services.localization.render('translation.key', [$date])
        {{/velocity}}
        

      Expected result

      The Velocity script should display the following:

      Parameter: 12 September 2018. Sentence with some 'single quotes' and "double quotes".

      Actual result

      The Velocity script outputs a message from which single quotes are missing:

      Parameter: 12 September 2018. Sentence with some single quotes and "double quotes".

      Workaround

      A workaround is to used doubled single quotes for such parameterized messages.

        Attachments

          Activity

            People

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

              Dates

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