You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tarek Nabil <Ta...@dubaiworld.ae> on 2006/12/04 11:27:31 UTC

REPOST: Internationalized messages for pure JavaScript client side validations

-----Original Message-----
From: Tarek Nabil 
Sent: Wednesday, November 29, 2006 10:17 AM
To: Struts Users Mailing List
Subject: Internationalized messages for pure JavaScript client side
validations

Hi,

I read the following in the documentation

<quote>
Errors are reported using the default validation message, not the
internationalized version that the server-side might be aware of. This
is a known issue. You may want to try the AJAX Client Side Validation
for messages that are fully internationalized.
</quote>

Is this feature impossible to implement using the current framework? I
don't want to go to the server for simple client side validations and
the internationalized messages are a must for me.

I looked at the code and it seems that this expression is the one that
yields the message
${validator.getMessage(action)?js_string}

I'm not into freemarker but it seems to be calling something on the
validator object. Is there a way we can enhance the validation object in
some way so that it exposes the internationalized message or is this
object not aware of the user's current locale at all? Could it be
enhanced so that it is aware of it?

Thanks,
Tarek Nabil

********************************************DISCLAIMER******************
**************************
This email and any files transmitted with it are confidential and
contain privileged or copyright 
information. If you are not the intended recipient you must not copy,
distribute or use this email
or the information contained in it for any purpose other than to notify
us of the receipt thereof.
If you have received this message in error, please notify the sender
immediately, and delete this
email from your system.

Please note that e-mails are susceptible to change.The sender shall not
be liable for the improper
or incomplete transmission of the information contained in this
communication,nor for any delay in
its receipt or damage to your system.The sender does not guarantee that
this material is free from
viruses or any other defects although due care has been taken to
minimise the risk.
************************************************************************
**************************
********************************************DISCLAIMER********************************************
This email and any files transmitted with it are confidential and contain privileged or copyright 
information. If you are not the intended recipient you must not copy, distribute or use this email
or the information contained in it for any purpose other than to notify us of the receipt thereof.
If you have received this message in error, please notify the sender immediately, and delete this
email from your system.

Please note that e-mails are susceptible to change.The sender shall not be liable for the improper
or incomplete transmission of the information contained in this communication,nor for any delay in
its receipt or damage to your system.The sender does not guarantee that this material is free from
viruses or any other defects although due care has been taken to minimise the risk.
**************************************************************************************************

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


Re: REPOST: Internationalized messages for pure JavaScript client side validations

Posted by Paul Benedict <pb...@apache.org>.
Tarek,

The Struts framework should be using the locale of the user. If you want 
to grab a certain language, have you set the locale first?

Paul

Chris Pratt wrote:
> Seems to me that if it returned a key instead of a message that you could
> use <fmt:message key="${message}"/> to retrieve the appropriate
> internationalized message cooresponding to the error.
>  (*Chris*)
> 
> On 12/4/06, Tarek Nabil <Ta...@dubaiworld.ae> wrote:
>>
>>
>> -----Original Message-----
>> From: Tarek Nabil
>> Sent: Wednesday, November 29, 2006 10:17 AM
>> To: Struts Users Mailing List
>> Subject: Internationalized messages for pure JavaScript client side
>> validations
>>
>> Hi,
>>
>> I read the following in the documentation
>>
>> <quote>
>> Errors are reported using the default validation message, not the
>> internationalized version that the server-side might be aware of. This
>> is a known issue. You may want to try the AJAX Client Side Validation
>> for messages that are fully internationalized.
>> </quote>
>>
>> Is this feature impossible to implement using the current framework? I
>> don't want to go to the server for simple client side validations and
>> the internationalized messages are a must for me.
>>
>> I looked at the code and it seems that this expression is the one that
>> yields the message
>> ${validator.getMessage(action)?js_string}
>>
>> I'm not into freemarker but it seems to be calling something on the
>> validator object. Is there a way we can enhance the validation object in
>> some way so that it exposes the internationalized message or is this
>> object not aware of the user's current locale at all? Could it be
>> enhanced so that it is aware of it?
>>
>> Thanks,
>> Tarek Nabil
>>
>> ********************************************DISCLAIMER******************
>> **************************
>> This email and any files transmitted with it are confidential and
>> contain privileged or copyright
>> information. If you are not the intended recipient you must not copy,
>> distribute or use this email
>> or the information contained in it for any purpose other than to notify
>> us of the receipt thereof.
>> If you have received this message in error, please notify the sender
>> immediately, and delete this
>> email from your system.
>>
>> Please note that e-mails are susceptible to change.The sender shall not
>> be liable for the improper
>> or incomplete transmission of the information contained in this
>> communication,nor for any delay in
>> its receipt or damage to your system.The sender does not guarantee that
>> this material is free from
>> viruses or any other defects although due care has been taken to
>> minimise the risk.
>> ************************************************************************
>> **************************
>>
>> ********************************************DISCLAIMER******************************************** 
>>
>> This email and any files transmitted with it are confidential and contain
>> privileged or copyright
>> information. If you are not the intended recipient you must not copy,
>> distribute or use this email
>> or the information contained in it for any purpose other than to 
>> notify us
>> of the receipt thereof.
>> If you have received this message in error, please notify the sender
>> immediately, and delete this
>> email from your system.
>>
>> Please note that e-mails are susceptible to change.The sender shall 
>> not be
>> liable for the improper
>> or incomplete transmission of the information contained in this
>> communication,nor for any delay in
>> its receipt or damage to your system.The sender does not guarantee that
>> this material is free from
>> viruses or any other defects although due care has been taken to minimise
>> the risk.
>>
>> ************************************************************************************************** 
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 

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


Re: REPOST: Internationalized messages for pure JavaScript client side validations

Posted by Chris Pratt <th...@gmail.com>.
Seems to me that if it returned a key instead of a message that you could
use <fmt:message key="${message}"/> to retrieve the appropriate
internationalized message cooresponding to the error.
  (*Chris*)

On 12/4/06, Tarek Nabil <Ta...@dubaiworld.ae> wrote:
>
>
> -----Original Message-----
> From: Tarek Nabil
> Sent: Wednesday, November 29, 2006 10:17 AM
> To: Struts Users Mailing List
> Subject: Internationalized messages for pure JavaScript client side
> validations
>
> Hi,
>
> I read the following in the documentation
>
> <quote>
> Errors are reported using the default validation message, not the
> internationalized version that the server-side might be aware of. This
> is a known issue. You may want to try the AJAX Client Side Validation
> for messages that are fully internationalized.
> </quote>
>
> Is this feature impossible to implement using the current framework? I
> don't want to go to the server for simple client side validations and
> the internationalized messages are a must for me.
>
> I looked at the code and it seems that this expression is the one that
> yields the message
> ${validator.getMessage(action)?js_string}
>
> I'm not into freemarker but it seems to be calling something on the
> validator object. Is there a way we can enhance the validation object in
> some way so that it exposes the internationalized message or is this
> object not aware of the user's current locale at all? Could it be
> enhanced so that it is aware of it?
>
> Thanks,
> Tarek Nabil
>
> ********************************************DISCLAIMER******************
> **************************
> This email and any files transmitted with it are confidential and
> contain privileged or copyright
> information. If you are not the intended recipient you must not copy,
> distribute or use this email
> or the information contained in it for any purpose other than to notify
> us of the receipt thereof.
> If you have received this message in error, please notify the sender
> immediately, and delete this
> email from your system.
>
> Please note that e-mails are susceptible to change.The sender shall not
> be liable for the improper
> or incomplete transmission of the information contained in this
> communication,nor for any delay in
> its receipt or damage to your system.The sender does not guarantee that
> this material is free from
> viruses or any other defects although due care has been taken to
> minimise the risk.
> ************************************************************************
> **************************
>
> ********************************************DISCLAIMER********************************************
> This email and any files transmitted with it are confidential and contain
> privileged or copyright
> information. If you are not the intended recipient you must not copy,
> distribute or use this email
> or the information contained in it for any purpose other than to notify us
> of the receipt thereof.
> If you have received this message in error, please notify the sender
> immediately, and delete this
> email from your system.
>
> Please note that e-mails are susceptible to change.The sender shall not be
> liable for the improper
> or incomplete transmission of the information contained in this
> communication,nor for any delay in
> its receipt or damage to your system.The sender does not guarantee that
> this material is free from
> viruses or any other defects although due care has been taken to minimise
> the risk.
>
> **************************************************************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>