Localization
From Pbxnsip Wiki
Version 2 is in general independent from languages. This makes it possible that new languages can be added without having to change the code of the program.
There are a few exceptions to this rule. The first exception is that the PBX automatically falls back to US-English when a requested resource is not available in the specified language. Therefore, it is a good idea to install the US-English files in any case.
The second exception is the spelling of numbers and dates. By default, all numbers and dates are spelled with the English number ordering. Only for German, there are several changes. As more languages are being added to the system, this will be improved in future releases.
Contents |
Web Interface
The web interface is generally language independent. The content is UTF-8 encoded, which makes it easy to use characters which are not on the core ASCII char set.
For every supported language, the PBX needs a file called lang_xx.xml, where xx is replaced with the language code (e.g. en, de, fr, sp). This file is being read after startup of the PBX process. It has a XML-encoded content which looks like this:
<?xml version="1.0" encoding="utf-8"?>
<language name="de">
<file>
<item id="yes">Ja</item>
<item id="no">Nein</item>
<item id="on">An</item>
<item id="off">Aus</item>
</file>
<file name="dom_accounts.htm">
<item id="name_ext">Durchwahl</item>
<item id="name_aa">Automatische Vermittlung</item>
</file>
</language>
The name attribute of the language tag indicates which language is being defined. It should be the same as the xx in the filename of the XML file.
For every file that exists in the web server, there should be an entry with the name "file", which lists the used texts in that page. The name of the web page must be indicated with attribute "name". If the attribute is missing, the PBX will use that item as a fallback, which can be used in all web pages (useful for often used items like "yes" or "no").
The XML file for US-English is available on demand and can be used as template.
Voice Interaction
The PBX uses voice prompts in many application areas, for example in the mailbox and the auto attendant. The necessary files are located in the working directory of the PBX in a directory with the name audio_xx. The PBX checks during startup, which directories are available and then determines which languages are installed.
In order to add a new language, you need to have the voice prompts. The files must have 8-kHz sampled WAV files in uncompressed audio format. You can use either u-law encoded files (8 bits per sample) or linear-encoded bytes (16 bits per sample).
If you want to record another language, please contact us for access to the list of needed prompts.
Ring Tones
Almost every country has its own ring tones. Those ring tones are also stored in the audio_xx directory. The PBX determines after startup, which tones are installed.
If you want to install a new ring tone, you must provide the files "ringback.wav" and "busy.wav".
Time Zones
The PBX is able to deal with several time zones at a time. This makes it possible, that every user can select his home time zone, so that for example mailbox messages are read out with the time zone of the user. The PBX also uses the time zone information during the provisioning of the phones, so that the phone will also use the time zone of the user.
In order to make this happen, the PBX needs a time zone configuration file (timezones.xml), which is encoded in XML and looks like this:
<?xml version="1.0" encoding="utf-8"?> <timezones dict="timezones.xml"> <zone name="AKDT"> <description>Alaska Time Zone</description> <gmt_offset>-32400</gmt_offset> <dst_offset>3600</dst_offset> <dst_start_day_of_week>1</dst_start_day_of_week> <dst_start_month>4</dst_start_month> <dst_start_time>02:00</dst_start_time> <dst_start_week_of_month>1</dst_start_week_of_month> <dst_stop_day_of_week>1</dst_stop_day_of_week> <dst_stop_month>10</dst_stop_month> <dst_stop_time>02:00</dst_stop_time> <dst_stop_week_of_month>Last</dst_stop_week_of_month> </zone> <zone name="CST"> <description>China, Taiwan</description> <gmt_offset>28800</gmt_offset> </zone> </timezones>
The name of the time zones is reflected in the lang_xx.xml file, where the translated name of the time zone can be found (xx replaced by the respective language). The description tag is used for fallback purposes.
A timezone must have the usual entries for GMT offset and the daylight savings information (see http://en.wikipedia.org/wiki/Daylight_saving_time). If a time zone has no daylight savings, those tags can be left out.
Unfortunately, the system file in Windows and Linux do not provide enough information to allow plug and play information. If you would like to add a time zone, please let us know. We will add more time zones in upcoming releases.
