commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Häberling <>
Subject [i18n] [Fwd: Re: Commons - I18N - adding timezones and filtering]
Date Sat, 05 Aug 2006 13:39:03 GMT

I've implemented two little extensions for the Commons-i18n project (See 
the mail below and the attached patch).
I'd like to see your comments on this.


Armin Häberling

-------- Original Message --------
Subject: Re: Commons - I18N - adding timezones and filtering
Date: Sat, 5 Aug 2006 14:49:56 +0200
From: Oliver Zeigermann <>
To: Armin Häberling <>
CC:, "Ralf Hauser" <>
References: <>

Hi Armin!

Thanks a lot for your patch. Would you mind resinding your complete
patch to the commons developer mailing list? This way everyone can
have a look at it and see if it fits into commons i18n.

Thanks a lot in advance and cheers


2006/8/4, Armin Häberling <>:
> Hi
> I've implemented two little extensions for the commons I18N project:
> 1) Timezone independence:
> Currently dates as message arguments are only displayed in the default
> time zone returned by the method TimeZone.getDefault().
> I extended the MessageManager.getText() so that one can also choose in
> which timezone Date arguments can be displayed.
> In the current implementation the message template must contain a date
> or time format so that the message is formated with the right timezone.
> That means the template "it's now {0}" will not work, whereas "it's now
> {o,time} will work.
> 2) filtering of message arguments:
> You may want to include String in message arguments that are untrusted
> (i.e. user input). But when you display such a message on a html site it
> may contain a javascript attack or other nasty things. Otherwise if you
> want to store the message in an sql table there are also attacks
> possible. Cause of this the arguments should be filtered depending on
> later use of the message.
> For this I created a new Filter Interface and extended the
> LocalizedBundle so that you can attach a specific filter which filters
> the message arguments before formating it. I also did two simple
> implementations of specific filters.
> I've attached a little patch with my changes. Any comments are welcome.
> Regards
> Armin Häberling

View raw message