|Translation Utility (xlate)|
The "xlate" utility is a tool to aid translators in the job of translation of the language files and maintenance of these files between versions. The tool uses a web based interface to aid in the translation process. The tool is not distributed with the main Inventory package, rather you may download it from our download area.
tar -zxvf xlate.tar.gz
In the first stage, you will be presented with a list of directories under the /lang/ subdir. The 'english' subdir will not display since it is used as the translation source. If you're just starting your translation, you may need to create a subdirectory for your language: Assuming your're translating for French, you will need to create a language directory called 'french' (note, all letters lowercase) under the /inv/lang/ directory. You may copy the language files from the 'english' directory to the new dir, but that is not mandatory. You must copy the file lang.main.php to the new directory, so you can specify your language settings there.
Adjust the $langSet array in lang.main.php (in your new directory) according to the instructions found here. It is important to set the encoding correctly or your language will not display properly.
Now choose the language directory from the list presented in the first stage. Clicking the language name will bring you
to the next step, where the language files in the directory are showm. You'll see a list of files (which are the langauge
resources). The tool compares the files in your language directory to the ones in 'english' language directory. If a file is
missing, it will be highlighted by the color red. (Files that exist in both directories will be shown in blue)
At this stage, the utility does not check if the files are similar or different, just if they exist or not. So a 'blue' file does not mean the file is ready/updated.
When the language file is displayed you can see the language info on top, the encoding used (you may change this by editing lang.main.php and changing the $langSet array), and a list of language resources in a table:
Each row in the table displays the language resource 'key' (left), the resource string in English (middle) and the current translation to your language (right). The list will highlight values you (may) need to change in red. Values are highlighted in red in the following cases:
Once you've edited the language, and are ready to finish work on this file, scroll to the bottom of the page
and click the button. This will generate a new window
with the PHP code for the current language file. You need to copy the contents of the window starting from the <? sign
and ending with ?> sign, and paste into your language file. Say we edited the French version of lang.computers.php,
you'll need to paste the contents into /inv/lang/french/lang.computers.php on the server.
Important note: if you're editing the lang.main.php file, the $langSet array will NOT be included in the result file. So if you're editing this file, append the language resources after the $langSet array in that file.