Added URL to two character country codes.
[squirrelmail.git] / doc / translating.txt
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>. 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.po into this directory. This is the
21 file that is going to be translated.
22
23 c) To translate the actual strings fill inn the msgstr after each
24 msgid with the appropiate translation. There are a few tools which
25 kan make this job a bit easier at
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
33 squirrelmail/functions/i18n.php. For a reference of correct two character
34 country codes refer to this <URL:http://palimpsest.stnford.edu/lex/iso639.html>.
35
36
37 2. Maintaining translations
38 ---------------------------
39
40 the text strings in the program will change over time. This means that
41 strings that are already translated is no longer used and new strings
42 are added. Therefore it is neccessary to maintain the translations.
43
44 a) There should always be an updated template containing all strings
45 in SquirrelMail in squirrelmail/squirrelmail.po. To merge all new
46 strings in this file into an existing translation run the command
47
48 msgmerge squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po \
49 squirrelmail/po/squirrelmail.po > \
50 squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po.new
51
52 This should keep all strings that are unchanged and comment out all
53 strings that are no longer in use. You might want to make a copy
54 before doing this.
55
56 b) Rung msgfmt again to create a new binary file.
57
58
59 3. Updating the template
60 ------------------------
61
62 This script comes from Serek:
63
64 #!/bin/bash
65 xgettext --keyword=_ -keyword=N_ \
66 --default-domain=squirrelmail/po/squirrelmail \
67 -C squirrelmail/src/*.php
68 xgettext --keyword=_ -keyword=N_ \
69 --default-domain=squirrelmail/po/squirrelmail \
70 -C -j squirrelmail/functions/*.php
71