You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by William Lee <wl...@sendmail.com> on 2001/12/13 01:58:25 UTC

intake and i18n

I'm actualy trying to use intake for an i18n site using Turbine 2.2b 
from CVS.  The way to get around the default English message in 
intake.xml definition is to treat all messages as keys to a 
ResourceBundle.  For example, in the intake.xml I have:

<rule name="maxLength" value="7">TEXT.a_key_to_bundle</rule>

then in my VM I just put a:

$i18n.get($group.FooField.Message)

This works great until the intake field fails for a generic cause. 
There are actually hard-coded English messages in a ValidationException 
that'll set the message in a field.  (For example, the "Entry is not a 
valid integer" message generated from the IntegerValidator.) Since the 
message I got is not a string key I defined and the i18n tool doesn't 
find it, it doesn't display correctly.  I'm pretty much stuck.

Is there anyway that the intake validator can parse my intake.xml file 
to get the default message for the different default validators?? 
Having hard-coded validator messages is probably a bad thing in any 
sense, but otherwise I'll have to write my own validators that do 
similar things.

Any guideline would be greatly appreciated.

-- 
William Lee (Will)        | Sendmail Inc.
Email:  wlee@sendmail.com | http://www.sendmail.com
Tel:    (510) 594-5505    |


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: intake and i18n

Posted by William Lee <wl...@sendmail.com>.
Actually, the code is actually there.  I needed to look at the code in 
order to figure out what's going on.  Anyway, you essentially need to 
add a rule called:

<rule name="notANumberMessage">Your Message</rule>

This looks weird to me though.  Shouldn't it be:

<rule name="isNumber">Entry is not an integer</rule>

Which somewhat makes more sense.

Will


> Simple: 
> 
>     Submit patches to make intake do what you need it to do properly.
> 
> We have the same requirements for Scarab..
> 
> -jon
> 


-- 
William Lee (Will)        | Sendmail Inc.
Email:  wlee@sendmail.com | http://www.sendmail.com
Tel:    (510) 594-5505    |


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: intake and i18n

Posted by Jon Scott Stevens <jo...@latchkey.com>.
on 12/12/01 4:58 PM, "William Lee" <wl...@sendmail.com> wrote:

> Is there anyway that the intake validator can parse my intake.xml file
> to get the default message for the different default validators??
> Having hard-coded validator messages is probably a bad thing in any
> sense, but otherwise I'll have to write my own validators that do
> similar things.
> 
> Any guideline would be greatly appreciated.

Simple: 

    Submit patches to make intake do what you need it to do properly.

We have the same requirements for Scarab..

-jon


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>