Contents Previous Next

5 Localizing error messages

The library has a quite extensive set of error messages to give hints and catch erroneous input to many of the controlling methods and also do sanity check on the data to be plotted.

All error messages are collected in resource files which are localized to a specific language. All resource files are located under the "lang/" directory in the JpGraph installation directory. The deafult locale to be used is defined in the configuration file with the setting DEFAULT_ERR_LOCALE in the distribution this is set to English locale.

The chosen locale is specified in the beginning of the script with a call to the static method JpGraphError::SetErrLocale(). The argument to this method is the ISO naming of the country/language to be selected. For example to enable the special production locale the following line should be added in the beginning of the script

JpGraphError::SetErrLocale('prod');
If an unknown or unsupported locale is given the error message will default to English.
Contents Previous Next