I've set up a workaround overwriting some Validator-classes to make the validator locale-aware. But I can't believe no validator-commiter noticed the problem before and changed the code in CVS. Maybe I'll post my replacement code in Validator Dev-List.
Thanks, Michael. > --- Ursprüngliche Nachricht --- > Von: Laurie Harper <[EMAIL PROTECTED]> > An: user@struts.apache.org > Betreff: Re: Some i18n issues > Datum: Wed, 14 Sep 2005 11:20:17 -0400 > > And for the validator issue, you can localize your validation rules by > defining a seperate set for each locale. I don't know if there's a way > to make the standard, included validations locale-aware but you can > define alternates where necessary if not. Also, Struts 1.3 will > introduce an 'extends' mechanism which will let you only override > validations for those fields that are locale sensitive without having to > repeat the rest. > > L. > > Ivan Rodriguez wrote: > > You have to use an initial value of "1000". > > > > <form-bean name="productForm" > > type="org.apache.struts.validator.DynaValidatorForm"> > > .... > > <form-property name="listprice" type="java.lang.String" > initial="1000" > > /> > > </form-bean> > > > > > > > > Then where you print this initial value, at your jsp, use formatting > > options: > > > > <bean:write name="productForm" property="listprice" > > formatKey="format.number" /> > > > > format.number is an entry in you MessageResources.properties > > > > For german MessageResources_de.properties: > > format.number=#0.000,00 > > > > For english MessageResources_en.properties: > > format.number=#0,000.00 > > > > > > Michael Ewers escribió: > > > >> Hi, > >> > >> I'm new to this group so first of all I'm pleased to have the > >> opportunity to > >> ask questions here. > >> > >> My question(s): > >> 1) I'm trying to write an application that supports i18n with Struts. > >> I use > >> DynaActionForm for my forms, so I defined them with initial values, > e.g.: > >> <form-bean name="productForm" > >> type="org.apache.struts.validator.DynaValidatorForm"> > >> .... > >> <form-property name="listprice" type="java.lang.String" > >> initial="1.000" > >> /> > >> </form-bean> > >> I have German and English users. My problem is that it seems to be > >> impossible to definie initial values for different languages. "1.000" > in > >> Germany means 1000, in UK it means 1. For German users the initial > value > >> should be "1,000". > >> Is there a solution for this problem? > >> > >> 2) If I use the Validator framework to validate double form values, > it's > >> basically the same problem: Validator seems to know English writing > >> rules of > >> double values but "1,00" is not a valid double value for Validator, > >> even if > >> the browser's Locale is set to German. > >> Is there a solution? > >> > >> Bye, > >> Michael. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > >> > >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]