Web hosting asp - Chapter 4: Architecture of an Intranet Application }

Chapter 4: Architecture of an Intranet Application } function load_error_code() { global $ERRORS; if (empty($ERRORS[$this->language])) { return FALSE; } while (list($key, $value) = each ($ERRORS[$this->language])) { $this->error_message[$key] = $value; } return TRUE; } } ?> The class.ErrorHandler.php class assumes that the application has all its error messages defined in an application-specific configuration file and all error messages are stored in a multidimensional array called $ERRORS. For example: If this code is stored in appname.errors file and loaded by an application using require_once( appname.errors ), then the ErrorHandler class can print the SAMPLE_ERR_CODE error message in any of the three languages, depending on the default language settings. You can translate your error messages in multiple languages using Language Translation Tools provided by Google at http://translate. google.com/translate_t. Be aware that not all automatic translations are perfect.

Leave a Reply