| 1 | How to translate SquirrelMail into another language? |
| 2 | ==================================================== |
| 3 | |
| 4 | This document does not deal with CVS and how to upload translations to |
| 5 | the repository. |
| 6 | |
| 7 | 1. First time translation |
| 8 | ------------------------- |
| 9 | |
| 10 | a) You must have gettext installed. If it is not installed you can |
| 11 | download the sources from |
| 12 | <URL:ftp://ftp.gnu.org/pub/gnu/gettext/>. |
| 13 | |
| 14 | b) Find the language code for the language you are going to translate |
| 15 | into. A list of language codes can be found at |
| 16 | <URL:http://lcweb.loc.gov/standards/iso639-2/langhome.html>. If |
| 17 | there is a 2 letter code for the language, use this. |
| 18 | |
| 19 | Create a directory squirrelmail/locale/language_code/LC_MESSAGES/. |
| 20 | Copy squirrelmail/po/squirrelmail.pot into this directory and rename |
| 21 | it to squirrelmail.po. This is the file that is going to be translated. |
| 22 | |
| 23 | c) To translate the actual strings fill in the msgstr after each |
| 24 | msgid with the appropriate translation. There are a few tools which |
| 25 | can make this job a bit easier at |
| 26 | <URL:http://i18n.kde.org/translation-howto/specialized-programs.html#gui-tools>. |
| 27 | |
| 28 | Convert the translated squirrelmail.po into a binary file by |
| 29 | running the command "msgfmt -o squirrelmail.mo squirrelmail.po" in |
| 30 | the directory where the translated squirrelmail.po is residing. |
| 31 | |
| 32 | d) Create locale/language_code/setup.php file with your translation description. |
| 33 | For example locale/tlh/setup.php |
| 34 | <?php |
| 35 | /* Klingon translation setup */ |
| 36 | $languages['tlh']['NAME'] = 'Klingon'; |
| 37 | $languages['tlh']['CHARSET'] = 'utf-8'; |
| 38 | ?> |
| 39 | |
| 40 | Before SquirrelMail 1.5.1 translation description should be added to |
| 41 | functions/i18n.php. Sample uses only required settings. Translation |
| 42 | description can use other advanced settings. Check include/i18n.php |
| 43 | or SquirrelMail developer's manual. |
| 44 | |
| 45 | There is also a small script in the po/ directory that can help in |
| 46 | creating charset mappings from the mappings files that are provided by |
| 47 | the Unicode consortium. |
| 48 | |
| 49 | 2. Maintaining translations |
| 50 | --------------------------- |
| 51 | |
| 52 | The text strings in the program will change over time. This means that |
| 53 | strings that are already translated are no longer used and new strings |
| 54 | are added. Therefore it is necessary to maintain the translations. |
| 55 | |
| 56 | a) There should always be an updated template containing all strings |
| 57 | in SquirrelMail in squirrelmail/po/squirrelmail.pot. To merge all new |
| 58 | strings in this file into an existing translation run the command |
| 59 | |
| 60 | msgmerge squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po \ |
| 61 | squirrelmail/po/squirrelmail.pot > \ |
| 62 | squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po.new |
| 63 | |
| 64 | This should keep all strings that are unchanged and comment out all |
| 65 | strings that are no longer in use. You might want to make a copy |
| 66 | before doing this. |
| 67 | |
| 68 | SquirrelMail contains po/mergepo script that can merge strings without need |
| 69 | to write that complex msgmerge command. Just put your translation name as |
| 70 | option. |
| 71 | |
| 72 | b) Run msgfmt again to create a new binary file. |
| 73 | |
| 74 | |
| 75 | 3. Updating the template |
| 76 | ------------------------ |
| 77 | |
| 78 | SquirrelMail provides po/xgetpo script that extracts all the required |
| 79 | strings and updates po/squirrelmail.pot file. |
| 80 | |
| 81 | |
| 82 | |
| 83 | $ Id: $ |