Localisation: how to switch interface language
There are a few simple steps you have to follow to set the Locale to one which is already prepared.
If you need to create a new translation then see the Translation document instead.
Step 1: Install gettext
Localisation uses the gettext package.
To install on Linux, it's usually either:
yum install gettext
or
apt-get install gettext
For Windows, this can be downloaded here. Need to ensure that msgfmt & it's DLL dependencies are available in the PATH.
NB PHP needs to be compiled with gettext support (this is the default for most packaged versions)
Step 2: Permissions
On the server file system, give read/write permission to the folder 'res/locale/' and all it's sub-directories:
chmod +x --recursive res/locale
Step 3: Set Locale
In the web interface, go to Administration → Localization → set Locale and select the desired Language
Step 4: Load translation file
Then go to Localization → Language Translation and press the 'Load Existing List' button. This will load the existing sahana.po file, which you can verify.
e.g. The Sinhala one looks as below:
#: ../inc/lib_security/acl_action_form.inc:40 msgid "* New Action : " msgstr "නව ක්රියා : "
#: ../inc/lib_security/acl_action_form.inc:41 #: ../inc/lib_security/acl_action_form.inc:130 msgid "* Description:" msgstr "විස්තරය"
Step 5: Compile translation file
Press the 'Compile Messages' button [This calls msgfmt to build the .mo file]
Step 6: Set Locale
Return to Administration → Localization → set Locale and re-select the desired Language.
All should now be working :) - if not, try restarting Apache.
Note: Some languages (e.g. Sinhala) require the clients to have particular Fonts installed to work properly (no fonts means boxes or numbers are shown instead) e.g. Sinhala fonts can be installed from http://sinhala.linux.lk/