Skip to main content.
Navigation: Home | Edit | HistoryLoginBackLinkIndex
Breadcrumbs : homepage » buglist » 1 » 36 » homepage » api » locale
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.
If you do create a different langauge version, please post back to the home of WikiD-X, so I can include it in future releases.

 

 

Default settings

The default settings for error messages are:{{nocamelcaselinks}}
  $MsgDir = "msgfiles";
  $MsgLanguage = "en";
  $MsgFile = "wikidx_msg.xml";
As usual, the defaults can be overwritten in custom.php files.

 

 

Msg API

When calling a msg, there are 3 functions you can call upon
  • API::MsgLang(<lang>wink - Set the language.
  • API::MsgFile(<file>wink - 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 >&lt;h4&gt;The page you have requested, ''%s'' does not yet exist.&lt;/h4&gt;You can create it now, by pressing the edit button.</wiki:act003>  
<wiki:act004 >&lt;&lt;edit '%s'&gt;&gt;</wiki:act004>  
</wiki:msg>