Language file format
General Informations
Since NagVis 1.x we changed the language format from simple textfiles to XML. The different files for NagVis, WUI, Labels were also merged together to one file per language.
The language files are stored in nagvis/includes/languages. The files are named .xml.
At the moment there are language files for the following languages:
Build your own...
Your language is not supported by NagVis? No problem! You can easily build your own language file. Just copy an existing file, rename it and change all the values you want to change.
If you built a new language file or fixed sth. in existing language files you're welcome to submit the file to us so we can implement it in the next NagVis release or publish it on Nagvis.org
XML Layout example
This is only an example to show the structure of the language files. If you like to see the complete structure of the language files, have a look at the delivered files at nagvis/includes/languages.
<?xml version="1.0" encoding="UTF-8" ?>
<language>
<meta>
<name>language-name</name>
<desc>language description</desc>
<version>language file version</version>
</meta>
<global>
<global>
<labels>
<!-- All labels which are used in NagVis and WUI //-->
<key>
<text>Value</text>
</key>
</labels>
<messages>
<!-- All messages which are used in NagVis and WUI //-->
<key>
<title>Title Value</title>
<text>Text Value</text>
</key>
</messages>
</global>
</global>
<nagvis>
<global>
<labels>
<!-- All labels which are used in NagVis //-->
<key>
<text>Value</text>
</key>
</labels>
<messages>
<!-- All messages which are used in NagVis //-->
<key>
<title>Title Value</title>
<text>Text Value</text>
</key>
</messages>
</global>
</nagvis>
<backend>
<global>
<messages>
<!-- All messages which are used in all backends //-->
<key>
<title>Title Value</title>
<text>Text Value</text>
</key>
</messages>
</global>
<ndomy>
<messages>
<!-- All messages which are used in NDO-MySQL backend //-->
<key>
<title>Title Value</title>
<text>Text Value</text>
</key>
</messages>
</ndomy>
<html>
<messages>
<!-- All messages which are used in HTML backend //-->
<key>
<title>Title Value</title>
<text>Text Value</text>
</key>
</messages>
</html>
</backend>
<wui>
<global>
<labels>
<!-- All labels which are used in WUI //-->
<key>
<text>Value</text>
</key>
</labels>
<messages>
<!-- All messages which are used WUI //-->
<key>
<title>Title Value</title>
<text>Text Value</text>
</key>
</messages>
</global>
<editMainCfg>
<labels>
<!-- All labels which are used in WUI Main Configuration //-->
<key>
<text>Value</text>
</key>
</labels>
<messages>
<!-- All messages which are used WUI Main Configuration //-->
<key>
<title>Title Value</title>
<text>Text Value</text>
</key>
</messages>
</editMainCfg>
<mapManagement>
<labels>
<!-- All labels which are used in WUI Map Management //-->
<key>
<text>Value</text>
</key>
</label>
<messages>
<!-- All messages which are used WUI Map Management //-->
<key>
<title>Title Value</title>
<text>Text Value</text>
</key>
</messages>
</mapManagement>
<addModify>
<labels>
<!-- All labels which are used in WUI Add/Modify //-->
<key>
<text>Value</text>
</key>
</label>
<messages>
<!-- All messages which are used WUI Add/Modify //-->
<key>
<title>Title Value</title>
<text>Text Value</text>
</key>
</messages>
</addModify>
</wui>
</language>
Macros
There is support for replacing given strings with some other values.
In the following language definition there are two types of replacements. First there is a string ([USER]) and second there are two default codes ([I] and [/i]) which are replaced with the same HTML-Tag without passing any values by calling the definition:
<permissionDenied>
<title>Permissions denied!</title>
<text>The user [I][USER][/I] has no permission to view this map!</text>
</permissionDenied>
When the language definition is called as follows, the string [USER] will be replaced by the value in $user.
$FRONTEND->messageToUser('ERROR','permissionDenied','USER~'.$user);
Default Macros
Default Macros are sth. like HTML-Tags which don't have to be defined by the user. At the moment the following default macros are supported:
| Macro | Replaced by |
| [i] | <i> |
| [/i] | </i> |
| [b] | <b> |
| [/b] | </b> |
Special Chars
Special chars like ä,ö,ü,",',... have to be set as HTML-entities (e.g. )