Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3837

StringResourceModel doesn't handle correctly resources containing a single quote

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.17, 1.5-RC5.1
    • 1.5-RC6
    • wicket

    Description

      When you have property values like these ones:
      Let's play!
      Let's play under the

      {0}

      The value is not handled properly and the final string values of the resource model become:
      Lets play!
      Lets play in the {0}

      Whereas the same resource, when used in a wicket:message tag or loaded through component.getResource(..) gets replaced correctly.
      [the first one is really relevant for wicket:message tags]

      I can have the proper behaviour if I double the quote (because of the internal call to MessageFormat), but in that case, the 2 quotes show when the wicket:message tag is used for that resource.

      This is problematic for multiple reasons:

      • the behaviour is not consistent
      • I can't reuse the same resource in different situations
      • I'd have to keep a registry of when a translated resource is used with a StringResourceModel and when it's used 'normally' and would have to make the company which translates our applications of the situation so that they could double the quotes when appropriate. This is unmanageable.

      Attachments

        1. WICKET-3837.patch
          4 kB
          Frédéric Donckels
        2. wicket-3837.patch
          8 kB
          Juegen Donnerstag

        Activity

          People

            jdonnerstag Juegen Donnerstag
            fdonckels Frédéric Donckels
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: