Table of contents ▼▲
Local Language Files
The message & error handling has been designed to be flexible and extendible.- You are able to add your own msg files
- Local language versions can also be added.
Default settings
The default settings for error messages are:{{nocamelcaselinks}}
$MsgDir = "msgfiles";
$MsgLanguage = "en";
$MsgFile = "wikidx_msg.xml";
Msg API
When calling a msg, there are 3 functions you can call upon-
API::MsgLang(<lang>
- Set the language.
-
API::MsgFile(<file>
- Set the file.
- API::Msg(<msg>, ...) - Display <msg>. You can then pass upto a further 10 values to be added to the msg. For example.
API::MsgFile("acl.msg");
API::Msg("acl001");
Message types
There are two types of message. A normal message where the text is simply processed and returned to the calling function, and a failing message where the messgae is issued and the wiki software exits. These are dentoed by the 'die="Y"' attribute.
Msg format
The msg files are standard XML format.<?xml version="1.0" encoding="UTF-8" ?>
<wiki:msg xmlns:wiki="//turland.net/wikidx" >
<!-- =========================================================== -->
<!-- Action msgs -->
<!-- =========================================================== -->
<wiki:act001 die="Y">Requested function '%s' associated with action '%s' cannot be found</wiki:act001>
<wiki:act002 die="Y">Delete failed trying to archive page</wiki:act002>
<wiki:act003 ><h4>The page you have requested, ''%s'' does not yet exist.</h4>You can create it now, by pressing the edit button.</wiki:act003>
<wiki:act004 ><<edit '%s'>></wiki:act004>
</wiki:msg>