You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Sebastian Gumpold <se...@sbs.co.at> on 2007/05/02 11:30:34 UTC

ResourceTool question

Hi all!

I'm having the following problems using the ResourceTool:

The Resource bundle entry:
test.entry = At {0} o'clock "{1}" occured.

Then I use the ResourceTool to get the message from the resoucre bundle 
and fill it with the ResourceTool.render() method with a list of two 
parameters.
The output I get is something like this:
At May 2, 2007 at 11:24 AM oclock "{1}" occured.

As you can see there are problems with the characters ' and ".
What can i do to avoid this problems?

Thanks in advance,
Sebastian

Re: ResourceTool question

Posted by Nathan Bubna <nb...@gmail.com>.
This probably has to do with MessageFormat's escaping of quotes.  I'm
no expert on that, so you'd probably do better to just read:

http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html

Also, you really shouldn't have to use the render() method directly in
most situations.  You can probably just do:

$text.test.entry.insert($arg0, $arg1)

instead of the two steps it sounds like you are using.

On 5/2/07, Sebastian Gumpold <se...@sbs.co.at> wrote:
> Hi all!
>
> I'm having the following problems using the ResourceTool:
>
> The Resource bundle entry:
> test.entry = At {0} o'clock "{1}" occured.
>
> Then I use the ResourceTool to get the message from the resoucre bundle
> and fill it with the ResourceTool.render() method with a list of two
> parameters.
> The output I get is something like this:
> At May 2, 2007 at 11:24 AM oclock "{1}" occured.
>
> As you can see there are problems with the characters ' and ".
> What can i do to avoid this problems?
>
> Thanks in advance,
> Sebastian

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org