cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@apache.org>
Subject Re: i18n Translations to String
Date Sun, 19 Nov 2006 13:56:20 GMT

On 17 Nov 2006, at 13:54, Vadim Gritsenko wrote:

>
>>   <message key="upload.progress.sent">Sent: {0}% ({1} of {2}  
>> bytes). Filename: {3}.</message>
>> I have not worked out yet how I18nTransformer does this ....
>
> All the work is done in ParamSaxBuffer. So instead of using  
> XMLResourceBundle.getString(key), you should be using getObject(key):
>
>   Map parameters = new HashMap();
>   parameters.put("1", "1234567");
>   ...
>   ParamSaxBuffer message = (ParamSaxBuffer) bundle.getObject(key);
>   message.toSAX(handler, parameters);
>
>
> ParamSaxBuffer currently does not have toString(Map parameters)  
> method in case if you want to get only text of the message, but  
> between SaxBuffer.toString() and ParamSaxBuffer.toSAX(handler,  
> parameters), I'm sure it won't take you long to implement toString 
> (Map parameters). :)

Well, many thanks Vadim, I seem to have this working now !!

Now I can throw away the nasty JXT json serializer :)


Thanks for your help !

regards Jeremy
Mime
View raw message