Part II: Developing Intranet Solutions You can set (Web site designers)
Part II: Developing Intranet Solutions You can set an application s default language using the $DEFAULT_LANGUAGE variable in a configuration file for your application. For example, If this configuration is loaded by an application using the ErrorHandler class, all error messages will be displayed in U.S. English. ErrorHandler() is the constructor function for the class.ErrorHandler.php. This function sets the default language of the error handler to what is set in the application configuration as global $DEFAULT_LANGUAGE variable. This method can be passed an associative array as a parameter. If the parameter array has a key=value pair called caller=class_name, then it sets the member variable called caller_class to the value. The constructor also initializes a member array called error_message and loads the error code for the default language by calling the load_error_code() method. The error handler class ErrorHandler is automatically invoked by the PHPApplication class so you don t need to create an error handler manually in your application code. Now let s look at the other functions available in ErrorHandler class. . alert(): This function displays an internationalized error message using a simple JavaScript pop-up alert dialog box. It is called with the error code. The get_error_message() method is used to retrieve the appropriate error message in default application language from the application s error configuration file. . get_error_message(): This function retrieves the error messages for given error code. If an array of error codes is supplied as parameter, the function returns an array of error messages. If no error code is supplied, the function returns a default error message using the MISSING error code. . load_error_code(): This function loads the application s error code in from the global $ERRORS array to its own member array variable error_message. This function is called from the constructor method and does not need to be called manually, unless you want to reload error messages from $ERRORS.