You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ipoese <ip...@cs.tu-berlin.de> on 2007/08/17 21:45:50 UTC

ValidationDelete Error Message Display and locale (!) translation

Hi Folks, 

for all those who cannot make much sense of my subject - sorry. I didn't
know any better way of putting it, really. 
So, after i got validation working and figured out how to use the
DelegationValidatior to display the Errors next to my input fields - here's
the next... challenge :)

Down to Business:
i need those errors translated into the current locale i am using (currently
i have two, but i need to be able to support more). I know how to do it
using the message prefix on components and the key span in html, but how do
i translate the acctual message thrown by the validator class ? do i have to
do it manually ? if so, where can i go fetch the keys and corresponding
translations for my current locale since i am really not up for specifying
the translations in a Java class - that would be mighty ugly - or so i
think...

so, if any of you guys ran into that one before, i would really appreciate a
some help.
Thanks a lot in advanche
-- 
View this message in context: http://www.nabble.com/ValidationDelete-Error-Message-Display-and-locale-%28%21%29-translation-tf4287771.html#a12206074
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: ValidationDelete Error Message Display and locale (!) translation

Posted by Andreas Andreou <an...@di.uoa.gr>.
If you get a reference to your page (from within the validator), you could
do page.getMessages().getMessage("NicknameAlreadyExists")
and use that in you exception. And you can do that in the toObject method by
formComponent.getPage() !



On 8/30/07, ipoese <ip...@cs.tu-berlin.de> wrote:
>
>
>
> ipoese wrote:
> >
> >
> > Erik Vullings-2 wrote:
> >>
> >> Does this link help:
> >>
> http://wiki.apache.org/tapestry/Tapestry5HowToOverrideTheDefaultErrorMessageBanner
> >>
> >
> > in general, yes, that would help to customize the error message quite
> > nicely - however, i am using tapestry 4.1 and not 5. Does 4.1 support
> that
> > feature aswell ?
> > Anyway, i am going to try that in the next few days...
> >
> > Thanks for the answer, and lets hope this works
> >
> >
>
> i've tried this with Tapestry 4.1, but somehow i am not getting the Errors
> translated. Furthermore, i am trying to translate Custom Validators -
> .i.e.
> i have written a validator wich checks if a username is arealy in use.
> Upon
> failure (the username already exists) i'm throwing the ValidationException
> with
>
> throw new ValidatorException("NicknameAlreadyExists",null);
>
> now, if i place the ValidationMessage_de.properties in the given source
> Package (like Eric kindly suggested) i am still getting
> NicknameAlreadyExists instead of the translated String which was defined
> in
> the ValidationMessage_de.properties.
> i've already said that i am using tapestry 4.1 and not 5... is there any
> other way anybody could possibly think of short of hardcoding the
> errormessages in the Validator ?
>
> many thanks in adavance, and sorry my reply took so long...
>
> --
> View this message in context:
> http://www.nabble.com/ValidationDelete-Error-Message-Display-and-locale-%28%21%29-translation-tf4287771.html#a12411558
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

Re: ValidationDelete Error Message Display and locale (!) translation

Posted by ipoese <ip...@cs.tu-berlin.de>.

ipoese wrote:
> 
> 
> Erik Vullings-2 wrote:
>> 
>> Does this link help:
>> http://wiki.apache.org/tapestry/Tapestry5HowToOverrideTheDefaultErrorMessageBanner
>> 
> 
> in general, yes, that would help to customize the error message quite
> nicely - however, i am using tapestry 4.1 and not 5. Does 4.1 support that
> feature aswell ?
> Anyway, i am going to try that in the next few days... 
> 
> Thanks for the answer, and lets hope this works
> 
> 

i've tried this with Tapestry 4.1, but somehow i am not getting the Errors
translated. Furthermore, i am trying to translate Custom Validators - .i.e.
i have written a validator wich checks if a username is arealy in use. Upon
failure (the username already exists) i'm throwing the ValidationException
with 

throw new ValidatorException("NicknameAlreadyExists",null);

now, if i place the ValidationMessage_de.properties in the given source
Package (like Eric kindly suggested) i am still getting
NicknameAlreadyExists instead of the translated String which was defined in
the ValidationMessage_de.properties. 
i've already said that i am using tapestry 4.1 and not 5... is there any
other way anybody could possibly think of short of hardcoding the
errormessages in the Validator ?

many thanks in adavance, and sorry my reply took so long...

-- 
View this message in context: http://www.nabble.com/ValidationDelete-Error-Message-Display-and-locale-%28%21%29-translation-tf4287771.html#a12411558
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: ValidationDelete Error Message Display and locale (!) translation

Posted by ipoese <ip...@cs.tu-berlin.de>.

Erik Vullings-2 wrote:
> 
> Does this link help:
> http://wiki.apache.org/tapestry/Tapestry5HowToOverrideTheDefaultErrorMessageBanner
> 

in general, yes, that would help to customize the error message quite nicely
- however, i am using tapestry 4.1 and not 5. Does 4.1 support that feature
aswell ?
Anyway, i am going to try that in the next few days... 

Thanks for the answer, and lets hope this works

-- 
View this message in context: http://www.nabble.com/ValidationDelete-Error-Message-Display-and-locale-%28%21%29-translation-tf4287771.html#a12250684
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: ValidationDelete Error Message Display and locale (!) translation

Posted by Erik Vullings <er...@gmail.com>.
Does this link help:
http://wiki.apache.org/tapestry/Tapestry5HowToOverrideTheDefaultErrorMessageBanner

Cheers
Erik

On 8/17/07, ipoese <ip...@cs.tu-berlin.de> wrote:
>
>
> Hi Folks,
>
> for all those who cannot make much sense of my subject - sorry. I didn't
> know any better way of putting it, really.
> So, after i got validation working and figured out how to use the
> DelegationValidatior to display the Errors next to my input fields -
> here's
> the next... challenge :)
>
> Down to Business:
> i need those errors translated into the current locale i am using
> (currently
> i have two, but i need to be able to support more). I know how to do it
> using the message prefix on components and the key span in html, but how
> do
> i translate the acctual message thrown by the validator class ? do i have
> to
> do it manually ? if so, where can i go fetch the keys and corresponding
> translations for my current locale since i am really not up for specifying
> the translations in a Java class - that would be mighty ugly - or so i
> think...
>
> so, if any of you guys ran into that one before, i would really appreciate
> a
> some help.
> Thanks a lot in advanche
> --
> View this message in context:
> http://www.nabble.com/ValidationDelete-Error-Message-Display-and-locale-%28%21%29-translation-tf4287771.html#a12206074
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>