You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stjepan Brbot <st...@ht.hr> on 2004/04/14 00:06:39 UTC

Date validator and I18N

In my web application I deal with three languages (Croatian, German and English). Application does have forms allowing user to input a date value. When english locale is active user must have the ability to insert date in english date format (mm/dd/yyyy), also croatian and german users must have the ability to insert dates in their own date format (dd.mm.yyyy). How to define a validation for such a situation? In mask for date validation (in validation.xml) I can define only one date format pattern!

Stjepan Brbot


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


Re: Date validator and I18N

Posted by Stjepan Brbot <st...@ht.hr>.
Thanks Nial and others. Yes, that's it, exactly. Unfortunately I have to duplicate my <formset> group for each language but I think copy/paste will help. BTW, I'll look at nightly build of Validator and its inheritance feature to see how could I exploit this new functionality.

Stjepan Brbot

"Niall Pemberton" <ni...@blueyonder.co.uk> wrote in message news:019801c421ad$2d5f5de0$a8ad2b52@DELL1800...
> In your validation.xml you can define different formsets for different
> localle by specifiying language/country/variant attributes
> 
>     <formset language="" country="" variant="">
> 
> Means you have to duplicate your validation rules for each language in
> Struts 1.1 - however the latest nightly build of validator includes an
> "inheritance" feature which I believe (don't know much more about it) will
> make this easier:
> 
> http://www.mail-archive.com/dev%40struts.apache.org/msg00259.html
> 
> Niall
> 



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


Re: Date validator and I18N

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
In your validation.xml you can define different formsets for different
localle by specifiying language/country/variant attributes

    <formset language="" country="" variant="">

Means you have to duplicate your validation rules for each language in
Struts 1.1 - however the latest nightly build of validator includes an
"inheritance" feature which I believe (don't know much more about it) will
make this easier:

http://www.mail-archive.com/dev%40struts.apache.org/msg00259.html

Niall


----- Original Message ----- 
From: "Stjepan Brbot" <st...@ht.hr>
To: <us...@struts.apache.org>
Sent: Tuesday, April 13, 2004 11:06 PM
Subject: Date validator and I18N


In my web application I deal with three languages (Croatian, German and
English). Application does have forms allowing user to input a date value.
When english locale is active user must have the ability to insert date in
english date format (mm/dd/yyyy), also croatian and german users must have
the ability to insert dates in their own date format (dd.mm.yyyy). How to
define a validation for such a situation? In mask for date validation (in
validation.xml) I can define only one date format pattern!

Stjepan Brbot


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





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