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.

After downloading the xlate.tar.gz package untar it into you inventory directory:

cd inv/
tar -zxvf xlate.tar.gz

This will create a tools/ subdirectory (if not already there) where the xlate utility files are stored.
Note You may want to password protect this directory via your webserver's configuration, since the tools included in it will not check for Inventory credentials
Using the "xlate" utility
Once the utility is installed, you may access it on your local server by accessing the /tools/ subdir using a web browser:

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)
Note 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.

Working with a single language file
The file list displays the language directory name (on top), and a list of files to work with. You may click the "up" link to go back to the language directory, or click a specific file to translate it.

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:

When hovering over the list items, the current list item row will be highlighted yellow.
Clicking a row will edit the contents: A black & green edit box will appear near the line where you may edit the current value. When finished, click the "Edit&qout; icon in the box to change the value.
The edited value will change color and become gray to indicate it was edited already.
Note Note that the \n sign is used for "line break" sign in string where it is required (like long error messages). Also, special values like %d or %s are place holders for digits and string, and you must keep them in the string. (Usually there's a comment in the original English language file explaining what this place holder stands for).

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.
Note 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.

Last comments
The xlate utility is build to also help langauge maintainers to easily find where new langauge resources were added between versions, the red marking enables easy access to new strings added to language resource files.