1

Topic: [FAQ] How to translate iRedAdmin to your language.

This tutorial is used to explain how to translate iRedAdmin to your language. If they don't work for you, please post a new topic in our iRedAdmin support forum.

Where can i download PO file used for translation?

=================================================

In iRedAdmin, both open source edition and Pro edition, there's a PO file 'i18n/iredadmin.po', you can make a copy and translate it.

How to translate iRedAdmin to your language

==================================================

Install necessary packages before we go further
# ---- On RHEL/CentOS ----
# yum install python-setuptools
# easy_install Babel

# ---- On Debian/Ubuntu ----
$ sudo apt-get install python-pybabel gettext
Extract strings from Jinja2 template files.
$ cd /path/to/iredadmin-x.y.z/i18n/
$ bash translation.sh zh_CN

What does 'translation.sh' script do?

  • It will create a new directory 'zh_CN' under 'i18n' directory if not exist. 'zh_CN' is a short name of your language name, you can find other short names in libs/languages.py.

  • Create zh_CN/LC_MESSAGES/iredadmin.po file if not exist.

  • Update zh_CN/LC_MESSAGES/iredadmin.po file if already exist.

  • Compile zh_CN/LC_MESSAGES/iredadmin.po to binary mo file: zh_CN/LC_MESSAGES/iredadmin.mo. iRedAdmin uses mo file only.

Directory structure is something like below:

iRedAdmin-x.y.z/
    |- libs/
        |- languages.py
    |- i18n/
        |- iredadmin.po
        |- msgfmt.py
        |- translation.sh
        |- zh_CN/
            |- LC_MESSAGES/
                |- iredadmin.po
                |- iredadmin.mo
Translate zh_CN/LC_MESSAGES/iredadmin.po.

In this PO file, msgid is original string need to be translated, msgstr is translated string.

NOTE: You can use PoEdit editor to help translate this file, it's better to translate it with a text editor. http://www.poedit.net
It will help compile the PO file to MO format while you saving your translation.

Convert po file to mo format.
$ cd /path/to/iredadmin-x.y.z/i18n/
$ bash translation.sh zh_CN

It will create or update zh_CN/LC_MESSAGES/iredadmin.mo.

Configure iRedAdmin to use your translation as default language in settings.ini
LANG = zh_CN
Visit your iredadmin in web browser, it should work for you now.

Preferred language is available for every admin, you can change it in 'Preference' link at the upper right corner after login.

http://iredmail.org/images/iredadmin/admin_profile_general.png