CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 onValidate Errormessages Internationalized

Print topic Send  topic

Author Message
Walter Kempees
Posted: 01/19/2006, 1:48 PM

Using Internationalization, (great feature), I stumbled on getting my custom
error messages translated.

Situation:
On any field (that needs it) or on the page Properties->On Validate enter
any condition you need to do your validation.
In your validation you will have to set an error message, to have that
internationalized:

(As an example a Date_From/To combination:)

Normal version
  
// -------------------------  
    // Write your own code here.  
// -------------------------  
  
  if ($formname->date_from->GetValue() > $form_name->date_to->GetValue() ){  
      $form_name->{Errors}->addError("Period incorrect!");  
 }  
//End Custom Code  

Internationalized version
  
// -------------------------  
    // Write your own code here.  
// -------------------------  
 global $CCSLocales;  
  
  if ($formname->date_from->GetValue() > $form_name->date_to->GetValue() ){  
      $form_name->{Errors}->addError(CCSLocales->GetText('Period_incorrect');  
 }  
//End Custom Code  
Added the global CCSLocales; and changed the error message text, as it
cannot contain special characters.

When finished, in Project Explorer expand "Resources" and "Locales" you will
find the languages u use there.
Double-click your language and the translator will appear.
For Locale (top row) I choose to set this to ALL giving a neat display of
all translated Keys.
Press "Add" enter the Key you just used and the text per language you want.
Close Translator.
Publish and

Presto!
Thanks Yes



Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.