You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dariusz Wojtas <dw...@gmail.com> on 2007/01/14 19:26:20 UTC

[S2] Internationalisation of conversion type messages

Hi,

Can someone help me figure out how to translate into my language field
names that have type conversion problems?

I have a Double field and put value: aa - obvious error.
Struts prints message:
   Invalid field value for field "myBean.myProperty".

I would like to change it to:
   Invalid field value for field "Translated field name".

I tried to put property
     invalid.fieldValue.myBean.myProperty=Translated field name
into files:
a) MyActionName.properties   (in the same package as the action being invoked)
b) package.properties  (the same package)
c) define custom i18.properties file and define it in struts.properties

but none of these solutions work.
Other messages get translated but not these from type conversion.

And how to translate the
   Invalid field value for field {0}.
message?

Any help?

regards
Dariusz Wojtas

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


Re: [S2] Internationalisation of conversion type messages

Posted by Dariusz Wojtas <dw...@gmail.com>.
I have created a custom Double converter and plugged it in using the
   xwork-conversion.properties
file in the root of the classpath. This works for me.
But I cannot manage it to use my translated field names in the response.

regards
Dariusz Wojtas

On 1/14/07, Martin Gainty <mg...@hotmail.com> wrote:
> My understanding is it is supposed to go thru this chain in package org.apache.struts.views.jsp.ui.
> default.properties
> WhateverNameOfActionClass_locale.properties
> WhateverNameOfActionClass.properties
>
> Conversions in Struts1 use Commons-Beanutils
> Conversions in Struts2 uses OGNL for type conversion
> http://struts.apache.org/2.x/docs/comparing-struts-1-and-2.html
>
> Anyone else?
> M-
> ----- Original Message -----
> From: "Dariusz Wojtas" <dw...@gmail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Sunday, January 14, 2007 1:26 PM
> Subject: [S2] Internationalisation of conversion type messages
>
>
> > Hi,
> >
> > Can someone help me figure out how to translate into my language field
> > names that have type conversion problems?
> >
> > I have a Double field and put value: aa - obvious error.
> > Struts prints message:
> >   Invalid field value for field "myBean.myProperty".
> >
> > I would like to change it to:
> >   Invalid field value for field "Translated field name".
> >
> > I tried to put property
> >     invalid.fieldValue.myBean.myProperty=Translated field name
> > into files:
> > a) MyActionName.properties   (in the same package as the action being invoked)
> > b) package.properties  (the same package)
> > c) define custom i18.properties file and define it in struts.properties
> >
> > but none of these solutions work.
> > Other messages get translated but not these from type conversion.
> >
> > And how to translate the
> >   Invalid field value for field {0}.
> > message?
> >
> > Any help?
> >
> > regards
> > Dariusz Wojtas

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


Re: [S2] Internationalisation of conversion type messages

Posted by Martin Gainty <mg...@hotmail.com>.
My understanding is it is supposed to go thru this chain in package org.apache.struts.views.jsp.ui.
default.properties
WhateverNameOfActionClass_locale.properties
WhateverNameOfActionClass.properties

Conversions in Struts1 use Commons-Beanutils
Conversions in Struts2 uses OGNL for type conversion
http://struts.apache.org/2.x/docs/comparing-struts-1-and-2.html

Anyone else?
M-
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Dariusz Wojtas" <dw...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Sunday, January 14, 2007 1:26 PM
Subject: [S2] Internationalisation of conversion type messages


> Hi,
> 
> Can someone help me figure out how to translate into my language field
> names that have type conversion problems?
> 
> I have a Double field and put value: aa - obvious error.
> Struts prints message:
>   Invalid field value for field "myBean.myProperty".
> 
> I would like to change it to:
>   Invalid field value for field "Translated field name".
> 
> I tried to put property
>     invalid.fieldValue.myBean.myProperty=Translated field name
> into files:
> a) MyActionName.properties   (in the same package as the action being invoked)
> b) package.properties  (the same package)
> c) define custom i18.properties file and define it in struts.properties
> 
> but none of these solutions work.
> Other messages get translated but not these from type conversion.
> 
> And how to translate the
>   Invalid field value for field {0}.
> message?
> 
> Any help?
> 
> regards
> Dariusz Wojtas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>