On Wednesday, April 2, 2003, at 01:09 AM, Victor Wiewiorowski wrote:
I am working on a multi-lingual web-application, I would like to display
dates (for example) in a format specific to the locale the application user
has requested. As this is a web-app serving multiple users, the
JVM Locale is of no use to me.
I was thinking that it would be nice if I could do this transparently, that
is within velocity whenever a Date is returned wrap it in a DateBean
which is constructed with the locale and displays the date appropriately.
I can *almost* do this in velocity-1.4-dev by writing my own Uberspect which wraps the default UberspectImpl returning a wrapper class in getPropertyGet.
However when it comes to evaluation I have no way of knowing for which context this evaluation is for, so I don't know what Locale the Date should be displayed in.
I think what needs to be done is the Info class should include the context
for which the evaluation is happening, this will make it possible to make
much more interesting Uberspect-s.
I certainly see the need, but, well, yuck :)
What I don't understand is why you don't deal with this at a higher level - i.e. because it's a formatting issue, the designer making the template knows when they are showing the date, and thus can use a tool placed into the context to format appropriate to that request.
Does that make sense?
geir
-- Geir Magnusson Jr 203-956-2604(w) Adeptra, Inc. 203-434-2093(m) [EMAIL PROTECTED] 203-247-1713(m)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
