You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jorge Merlino <jo...@ipcontact.com.uy> on 2008/11/19 14:30:16 UTC
Overriding default error messages
Hi
I'm developing an application that has to work in english, spanish and
portuguese so I have to override the default validation error title (which
says "You must correct the following errors before you may continue")
I have read that this can be done adding a new Errors.properties file to my
application jar in the same package as the original tapestry one. I have done
so but I couldn't get it to work properly. I'm still seeing the english
message in all three locales.
In fact it is not clear to me why this should work because I have the exact
same package in two jar files and I don't see why java should prefer mine
over the tapestry one.
Is this the correct way of doing this or am I doing something wrong?
By the way I see that tapestry includes some translations for the
Errors.properties file but no spanish or generic portuguese (only portuguese
from portugal). I could provide translations for this files for the next
realease but maybe I should suscribe to the dev list to discuss this.
Best regards
Jorge
Re: Overriding default error messages
Posted by Hugo Palma <hu...@gmail.com>.
Yeah, sorry, the spanish and brazilian portuguese translations are only
available on 5.0.16.
Maybe that's why your'll only seeing the default (english) message. Did
you try using the pt_PT locale instead of the es or pt_BR to see if it
works on 5.0.15 ?
Jorge Merlino wrote:
> El Mié 19 Nov 2008 a las 11:42:34 Hugo Palma escribió:
>
>> Hi Jorge,
>>
>> tapestry already provides an Errors_es.properties, Errors_pt_PT.properties
>> and an Errors_pt_BR.properties. So you should see the localized message
>> just fine. Are you sure your using the correct locale ?
>>
>
> That is strange. This is what I see in the tapestry core jar that maven
> downloaded:
>
> [root@negra64 lib]# jar tvf tapestry-core-5.0.15.jar | grep Errors
> org/apache/tapestry5/corelib/components/Errors.class
> org/apache/tapestry5/corelib/components/Errors.properties
> org/apache/tapestry5/corelib/components/Errors_da.properties
> org/apache/tapestry5/corelib/components/Errors_de.properties
> org/apache/tapestry5/corelib/components/Errors_fi_FI.properties
> org/apache/tapestry5/corelib/components/Errors_fr_FR.properties
> org/apache/tapestry5/corelib/components/Errors_hr.properties
> org/apache/tapestry5/corelib/components/Errors_it.properties
> org/apache/tapestry5/corelib/components/Errors_pt_PT.properties
> org/apache/tapestry5/corelib/components/Errors_ru.properties
> org/apache/tapestry5/corelib/components/Errors_sv_SE.properties
> org/apache/tapestry5/corelib/components/Errors_zh_CN.properties
>
> Are those translations in tapestry 5.0.16?
>
>
>> For example, if you provide a localized message resource for a component or
>> page of ur own application does it get picked up ?
>>
>
> The localization for the rest of the components is working fine. Only this
> error header message remains in english all the time.
>
> Regards
> Jorge
>
Re: Overriding default error messages
Posted by Jorge Merlino <jo...@ipcontact.com.uy>.
El Mié 19 Nov 2008 a las 11:42:34 Hugo Palma escribió:
> Hi Jorge,
>
> tapestry already provides an Errors_es.properties, Errors_pt_PT.properties
> and an Errors_pt_BR.properties. So you should see the localized message
> just fine. Are you sure your using the correct locale ?
That is strange. This is what I see in the tapestry core jar that maven
downloaded:
[root@negra64 lib]# jar tvf tapestry-core-5.0.15.jar | grep Errors
org/apache/tapestry5/corelib/components/Errors.class
org/apache/tapestry5/corelib/components/Errors.properties
org/apache/tapestry5/corelib/components/Errors_da.properties
org/apache/tapestry5/corelib/components/Errors_de.properties
org/apache/tapestry5/corelib/components/Errors_fi_FI.properties
org/apache/tapestry5/corelib/components/Errors_fr_FR.properties
org/apache/tapestry5/corelib/components/Errors_hr.properties
org/apache/tapestry5/corelib/components/Errors_it.properties
org/apache/tapestry5/corelib/components/Errors_pt_PT.properties
org/apache/tapestry5/corelib/components/Errors_ru.properties
org/apache/tapestry5/corelib/components/Errors_sv_SE.properties
org/apache/tapestry5/corelib/components/Errors_zh_CN.properties
Are those translations in tapestry 5.0.16?
>
> For example, if you provide a localized message resource for a component or
> page of ur own application does it get picked up ?
The localization for the rest of the components is working fine. Only this
error header message remains in english all the time.
Regards
Jorge
Re: Overriding default error messages
Posted by Hugo Palma <hu...@gmail.com>.
Hi Jorge,
tapestry already provides an Errors_es.properties, Errors_pt_PT.properties
and an Errors_pt_BR.properties. So you should see the localized message just
fine. Are you sure your using the correct locale ?
For example, if you provide a localized message resource for a component or
page of ur own application does it get picked up ?
On Wed, Nov 19, 2008 at 1:30 PM, Jorge Merlino <
jorge.merlino@ipcontact.com.uy> wrote:
> Hi
>
> I'm developing an application that has to work in english, spanish and
> portuguese so I have to override the default validation error title (which
> says "You must correct the following errors before you may continue")
> I have read that this can be done adding a new Errors.properties file to my
> application jar in the same package as the original tapestry one. I have
> done
> so but I couldn't get it to work properly. I'm still seeing the english
> message in all three locales.
> In fact it is not clear to me why this should work because I have the exact
> same package in two jar files and I don't see why java should prefer mine
> over the tapestry one.
> Is this the correct way of doing this or am I doing something wrong?
>
> By the way I see that tapestry includes some translations for the
> Errors.properties file but no spanish or generic portuguese (only
> portuguese
> from portugal). I could provide translations for this files for the next
> realease but maybe I should suscribe to the dev list to discuss this.
>
> Best regards
> Jorge
>