Skin Translation
From wiliGear wiki
Introduction
This document provides instructions how to translate current skin to a certain language. The person who will make the translation of the skin should have basic HTML and preffered PHP knowledge.
Instructions
| | The notice to a person not familiar with PHP: the double quotes and the single quotes are different. In some cases the double quotes may be replaced by single quotes and in some cases they cannot. |
Step 1. Unzip the .tgz file of the skin. It is important to know that the skin archive has no wrapping directory and the whole structure shall not be changed. This means that some files (page.cgi, version.txt) should be in the root directory, some of them in ctrl or lib, etc. Moving the files to another directory will break the skin.
Step 2. In the directory images the logos, banners and images can be replaced. The same dimensions are recommended to be observed, otherwise the images may be displayed streched, cropped, etc.
Step 3. The directory view contains *.tmpl files (HTML and PHP code files). Translate the english strings visible in the page into your language. For example in the line:
<th>Current channel</th>
you have to replace the string 'Current channel'. Please notice that there are some tricky places such like drop-down lists. Their options are pre-filled in arrays:
$chan_attributes = array('full'=>'Full', 'half'=>'Half', 'quarter'=>'Quarter');
$opt_roles = array('serviceset' => 'Service Set',
'uplink' => 'Uplink',
'downlink' => 'Downlink');
In the above example the values of the parameters but not the keys (the strings following the arrows (=>) such as Full, Half, Quarter, Service Set, Uplink, Downlink) have to be translated and changed.
Step 4. In *.php and *.inc files contained in the directories ctrl and lib search for the strings "add_message" and "add_error". The text between quotes have to be translated. Please notice that the strings may contain variables.
add_error("Incorrect SSID for radio $devname has been provided. ".
"It should be up to 32 characters.");
add_message('The selected radio ' . $aifname . ' for ack timeout test is disabled.');
In the above example the variable $devname in first string and $aifname in the second one shall not be changed. Both these variables mean radio names: ath0, ath1, etc. Some other strings may contain variables such as numerical values or other untranslatable data.
Step 5. In *.cgi and *.js files contained in the root directory search for the strings "add_error", "add_message" and "alert" (only in *.js files) and translate them the same as in the previous step.
Step 6. The menu items are stored in one file: ctrl/menu.php
$menu_stats = new Menu('stats', 'Status', 'page.cgi?page=status');
$menu_stats->add(new Menu('status', 'System Information', 'page.cgi?page=status'));
$menu_stats->add(new Menu('netstat', 'Interfaces', 'page.cgi?page=netstat'));
In the menu file, only the description strings (Status, System Information, Interfaces) have to be translated.
Step 7. Put the translated skin into the archive. Please notice, that you have to archive the skin into the same format (tgz = tar + gzip), without the directory where the archive has been extracted in (for example if you extracted the skin.tgz into the directory 'my_skin', put into the archive only its contents without directory named 'my_skin').
| | For Windows OS users: the .tgz archive format can be made only under Linux OS. Use our Firmware Factory to convert windows archive format to a proper .tgz format (use Upload button next to Skins block, choose and upload your archive. The conversion to .tgz format will be done automatically. After the format conversion is done and your archive is visible in Skin block, you can Download your Skin converted to .tgz). |
Step 8. Test the translated skin by uploading it to a test device and activating it. In case the translated skin is not working, you have to reset the device to the factory defaults, by using the reset button on the device (then the device will load the default built-in skin).
