Inventory can localized to display all information in your language. (Including support for Left-to-Right
and Right-to-Left languages). This document explains how to localize Inventory for your language.
You can now use the
the xlate utility to help aid the translation process.
If you take the time to make a translation of Inventory to your local language, please share it.
Mail me if you wish to contribute your translation work.
The lang/ directory contains all available language resources for Inventory. Each language has it's own
directory where the language data is stored in multiple files. When setting
the $inv_data[lang] paramter, you're referring to this directory. The 'english' subdirectory contains the
main (and default) translation for Inventory, and should always be kept.
These are the steps for creating a new translation:
- Make a copy of the 'english' subdirectory, and name it according to your language.
It is recommended to keep the directory name all in lowercase letters.
- Edit the lang.main.php file (it is the main language file), and modify the information
found near the top, where the $langSet[] array is defined.
Here is a short explanation for this array:
- The 'name' key contains a string with the languge name. This string is used
to display the language in dialogs.
- The 'encode' key defines the encoding to use in <META> tags when displaying
HTML pages with this lang. (charset).
- The 'dir' key defines language direction. Use the value 'ltr' for left-to-right
written languages (most common), or 'rtl' for right-to-left written languages
- The language resources themselves are stored in the $_L[] array. Do not change array keys,
rather just translate the values to your language. You may start from the strings inside
lang.main.php and continue through all the lang.*.php files in the directory. (each constains
language resources which are specific for a different section/module in Invnetory).
- Translation note: some strings will include values like %s or %d - these are used
to print (dynamic) data into the string when displaying data.
You must keep these tokens in the string and not remove them.
Most such strings have a comment attached which explains what each
'place holder' will contain when the string will be displayed.
* Note - you need to change the $inv_data[lang] var in include/cfg.php to the new language to
see your translation results.