cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject Re: i18n Translations to String
Date Thu, 16 Nov 2006 18:02:49 GMT

On 16 Nov 2006, at 16:55, Vadim Gritsenko wrote:

> Jeremy Quinn wrote:
>> Hi All
>> I am close to finishing an UploadProgressBar Dojo Widget for  
>> CForms and am trying to implement i18n status messages.
>> I have a FlowScript that reads the upload status and sends this as  
>> JSON to the UploadProgressBar.
>> I was trying to avoid using JXTemplate for the serialization,  
>> instead, I serialize the data (a Map) to JSON in FlowScript and  
>> send it using :
>>     <map:match pattern="send-json">
>>        <map:read src="module:flow-attr:json" mime-type="text/ 
>> javascript" />
>>     </map:match>
>> I was hoping to do i18n lookup in FlowScript using  
>> o.a.c.forms.util.I18nMessage but of course it outputs SAX events,  
>> not Strings :(
>> I will either have to switch to using JXT for serialization, or  
>> find an alternative i18n lookup mechanism.
>> Any suggestions anyone ?
> I18nMessage does not do lookups: I18nTransformer does.

Yes, I just had not noticed before, because I always used it with JXT.

> Now if you want to play I18nTransformer in Flow, you need to lookup  
> catalogue from XMLResourceBundleFactory, and then you can translate  
> the key into String using XMLResourceBundle.getString(key) method.  
> You'll lose any HTML markup which was in the translation, you'll  
> get only message text.

Thanks for the explanation, Vadim.

I will give that a try.

best regards


View raw message