Yeah, MessageTool wouldn't make a transformation like that. Pretty sure this is a Struts issue. Good luck! :)
On Wed, Jan 27, 2016 at 11:25 AM, Christopher Schultz < ch...@christopherschultz.net> wrote: > All, > > Using Velocity-Tools 2.0. > > I've got a resource bundle with the following message in it: > > text.patient.questionnaires.available=There {0,choice,0#are no > questionnaires|1#is one questionnaire|1<are '<b>'{0}'<b>' > questionnaires} ready to take > > (That's all on one single line, in case my emailer wraps it, or maybe > yours does.) > > I have a problem where the <b> HTML markup is making ChoiceFormat angry: > > Caused by: java.lang.IllegalArgumentException: Choice Pattern incorrect: > 0#are no questionnaires|1#is one questionnaire|1<are ''<b>''{0}''<b>'' > questionnaires > at java.text.MessageFormat.makeFormat(MessageFormat.java:1519) > at java.text.MessageFormat.applyPattern(MessageFormat.java:479) > at java.text.MessageFormat.<init>(MessageFormat.java:362) > at > > org.apache.struts.util.MessageResources.getMessage(MessageResources.java:305) > at > org.apache.velocity.tools.struts.MessageTool.get(MessageTool.java:157) > at > org.apache.velocity.tools.struts.MessageTool.get(MessageTool.java:125) > at > org.apache.velocity.tools.struts.MessageTool.get(MessageTool.java:191) > [...] > > Note that the pattern for the ChoiceFormat has been modified: there are > extra single-quote characters in the format that ChoiceFormat complains > about. > > I haven't yet read through all the code, but if this jogs anyone's > memory for why something like this might happen, it would be very > helpful to me. > > A couple of notes: > > 1. I have a custom build of Velocity-Tools, so the line numbers are not > always correct. I have confirmed that my changes do not modify the > message key's value. > > 2. It looks like in MessageTool.java:157, the value has the expected ... > umm ... value. That is, it does not have doubled single quotes. So I > think this is almost certainly not Velocity Tools's fault. I may have to > give into the Struts code. > > Thanks, > -chris > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org > For additional commands, e-mail: user-h...@velocity.apache.org > >