Internationalization (i18n) in DAVAdmin
DavAdmin uses the Smarty (http://smarty.php.net) template engine and GNU gettext for internationalization. All PHP and JavaScript code is internationalizable using gettext.
Each supported language has to be added to the following files:
- Makefile
the variable TRANSLANG at the top of the Makefile contains all locale or language names that have a translation separated by spaces - admin/i18n.inc.php
this file contains a function get_language_data() at the top that defines two associative arrays with language and country to locale mapping as well as language to default country mapping. These arrays have to be extended to support new languages
To start a translation in a new language you have to perform the above file changes and perform theses steps:
- copy the directory admin/templates/en to admin/templates/<yourlang>. I.e for a russian translation you'd use
cp -R admin/templates/en admin/templates/ru
- translate all files in admin/templates/<yourlang> with a text editor of your choice
- execute make
- edit the message catalog (.po file) for your language with a capable editor (poedit or GNU Emacs are good choices). I.e for russian translation with GNU Emacs you'd execute
emacs po/ru/LC_MESSAGES/davadmin.po
- execute make again
If you'd like to get your language included please add patches to a new ticket (you need to be registered and logged in first).
