Translating Sahana

This document shows how to add a new, currently unsupported language to Sahana.

If instead, you wish to activate an already-supported language, please see the Localization doc.


Sahana uses GNU Gettext for Localization/Internationalization of the Sahana interface.

The gettext tutorial has a section for translators, you can take a look at it and get an idea on how gettext translation works.

Basic Steps

For translating Sahana the basic steps would be,

  1. Download the latest message template (for a new translation).
  2. Open the Sahana.pot file using a text editor that supports UTF-8
  3. Insert the translated strings.
  4. Save the file and commit it (or email the file to

Downloading the sahana.pot file

If you have Sahana Launchpad access you can checkout Sahana; or if you don't have Launchpad access follow these installation instructions.

You can find the sahana.pot file inside the '<sahana root>/res/locale/' directory (<sahana root>/res/locale/sahana.pot).

Doing the translation

After downloading the file open it using your favorite (UTF enabled) text editor (e.g: gedit). Make sure you select UTF-8 when you edit and save the sahana.po file. When you open the file you will see a list of strings from the Sahana interface.

 #: ../inc/lib_security/
 #: ../inc/lib_security/
 msgid "Description:"
 msgstr ""

When translating you have to enter the translated word for the 'msgid' (that's “Description:” in the example) between “” of the 'msgstr'.

 msgid "Description:"
 msgstr "<the translation of 'Description:'>"
 #: ../inc/lib_security/
 #: ../inc/lib_security/
 msgid "Description:"
 msgstr "විස්තර:"

please do not alter the 'msgid' string.

Uploading the translated file

After doing the translation, if you have Launchpad commit rights, create the directory structure with the correct language code and the country code in side the <sahana root>/res/locale/ directory.

    si - language code
    LK - country code

save the translated file in side of the new 'LC_MESSAGES/' directory as sahana.po


then add the file to the Launchpad repository. Then commit the file. After this you can use the 'sahana.po' file in the specific locale directory (e.g. 'si_LK/LC_MESSAGES/sahana.po') for updating the translation.

  • If you don't have Launchpad access save the file as sahana_<language code>_<country code>.po (e.g. sahana_si_LK.po) and upload it to the BugTracker

QR Code
QR Code doc:translation:english (generated for current page)