7f029a23 |
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 soources 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://www.dsv.su.se/~jpalme/ietf/language-codes.html>. |
17 | |
18 | Create a directory squirrelmail/locale/language_code/LC_MESSAGES/. |
19 | Copy squirrelmail/po/squirrelmail.po into this directory. This is the |
20 | file that is going to be translated. |
21 | |
22 | c) To translate the actual strings fill inn the msgstr after each |
23 | msgid with the appropiate translation. There are a few tools which |
24 | kan make this job a bit easier at |
25 | <URL:http://i18n.kde.org/translation-howto/gui-specialized-apps.html>. |
26 | |
27 | Convert the translated squirrelmail.po into a binary file by |
28 | running the command "msgfmt -o squirrelmail.mo squirrelmail.po" in |
29 | the directory where the translated squirrelmail.po is residing. |
30 | |
31 | d) Add the language name and language code to the array at the top of |
32 | squirrelmail/functions/i18n.php. |
33 | |
34 | |
35 | 2. Maintaining translations |
36 | --------------------------- |
37 | |
38 | the text strings in the program will change over time. This means that |
39 | strings that are already translated is no longer used and new strings |
40 | are added. Therefore it is neccessary to maintain the translations. |
41 | |
42 | a) There should always be an updated template containing all strings |
43 | in SquirrelMail in squirrelmail/squirrelmail.po. To merge all new |
44 | strings in this file into an existing translation run the command |
45 | |
46 | msgmerge squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po \ |
47 | squirrelmail/po/squirrelmail.po > \ |
48 | squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po |
49 | |
50 | This should keep all strings that are unchanged and comment out all |
51 | strings that are no longer in use. You might want to make a copy |
52 | before doing this. |
53 | |
54 | b) Rung msgfmt again to create a new binary file. |
55 | |
56 | |
57 | 3. Updating the template |
58 | ------------------------ |
59 | |
60 | This script comes from Serek: |
61 | |
62 | #!/bin/bash |
63 | xgettext --keyword=_ -keyword=N_ --default-domain=squirrelmail/po/squirrelmail\ |
64 | -C squirrelmail/src/*.php |
65 | xgettext --keyword=_ -keyword=N_ --default-domain=squirrelmail/po/squirrelmail\ |
66 | -C -j squirrelmail/functions/*.php |
67 | |