CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 onValidate Errormessages Internationalized

Print topic Send  topic

Author Message
Walter Kempees
Posted: 01/19/2006, 1:52 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() > $formname->date_to->GetValue() ){  
      $formname->{Errors}->addError("Period incorrect!");  
 }  
//End Custom Code  

Internationalized version
  
// -------------------------  
    // Write your own code here.  
// -------------------------  
 global $CCSLocales;  
  
  if ($formname->date_from->GetValue() > $formname->date_to->GetValue() ){  
      $formname->{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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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