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 |
47c5f7fc |
11 | download the sources from |
7f029a23 |
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 |
e47c673b |
16 | <URL:http://lcweb.loc.gov/standards/iso639-2/langhome.html>. If |
974dd86d |
17 | there is a 2 letter code for the language, use this. |
7f029a23 |
18 | |
19 | Create a directory squirrelmail/locale/language_code/LC_MESSAGES/. |
20 | Copy squirrelmail/po/squirrelmail.po into this directory. This is the |
21 | file that is going to be translated. |
22 | |
1e63b430 |
23 | c) To translate the actual strings fill in the msgstr after each |
47c5f7fc |
24 | msgid with the appropriate translation. There are a few tools which |
1e63b430 |
25 | can make this job a bit easier at |
7f029a23 |
26 | <URL:http://i18n.kde.org/translation-howto/gui-specialized-apps.html>. |
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) Add the language name and language code to the array at the top of |
219c74f8 |
33 | squirrelmail/functions/i18n.php. |
7f029a23 |
34 | |
e3c6f613 |
35 | There is also a small script in the po/ directory that can help in |
36 | creating charset mappings from the mappings files that are provided by |
37 | the Unicode consortium. |
7f029a23 |
38 | |
39 | 2. Maintaining translations |
40 | --------------------------- |
41 | |
1e63b430 |
42 | The text strings in the program will change over time. This means that |
43 | strings that are already translated are no longer used and new strings |
44 | are added. Therefore it is necessary to maintain the translations. |
7f029a23 |
45 | |
46 | a) There should always be an updated template containing all strings |
47 | in SquirrelMail in squirrelmail/squirrelmail.po. To merge all new |
48 | strings in this file into an existing translation run the command |
49 | |
50 | msgmerge squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po \ |
51 | squirrelmail/po/squirrelmail.po > \ |
0a52832c |
52 | squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po.new |
7f029a23 |
53 | |
54 | This should keep all strings that are unchanged and comment out all |
55 | strings that are no longer in use. You might want to make a copy |
56 | before doing this. |
57 | |
47c5f7fc |
58 | b) Run msgfmt again to create a new binary file. |
7f029a23 |
59 | |
60 | |
61 | 3. Updating the template |
62 | ------------------------ |
63 | |
64 | This script comes from Serek: |
65 | |
66 | #!/bin/bash |
4d732f7e |
67 | xgettext --keyword=_ -keyword=N_ \ |
68 | --default-domain=squirrelmail/po/squirrelmail \ |
69 | -C squirrelmail/src/*.php |
70 | xgettext --keyword=_ -keyword=N_ \ |
71 | --default-domain=squirrelmail/po/squirrelmail \ |
72 | -C -j squirrelmail/functions/*.php |
7f029a23 |
73 | |
47c5f7fc |
74 | |
75 | |
76 | |
77 | $ Id $ |