tweaks, fixed some misspellings, added a few hooks
[squirrelmail.git] / doc / translating.txt
CommitLineData
7f029a23 1How to translate SquirrelMail into another language?
2====================================================
3
4This document does not deal with CVS and how to upload translations to
5the repository.
6
71. First time translation
8-------------------------
9
10a) 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
14b) 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
23c) 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
32d) Add the language name and language code to the array at the top of
219c74f8 33 squirrelmail/functions/i18n.php.
7f029a23 34
35
362. Maintaining translations
37---------------------------
38
39the text strings in the program will change over time. This means that
40strings that are already translated is no longer used and new strings
41are added. Therefore it is neccessary to maintain the translations.
42
43a) There should always be an updated template containing all strings
44 in SquirrelMail in squirrelmail/squirrelmail.po. To merge all new
45 strings in this file into an existing translation run the command
46
47msgmerge squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po \
48squirrelmail/po/squirrelmail.po > \
0a52832c 49squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po.new
7f029a23 50
51 This should keep all strings that are unchanged and comment out all
52 strings that are no longer in use. You might want to make a copy
53 before doing this.
54
55b) Rung msgfmt again to create a new binary file.
56
57
583. Updating the template
59------------------------
60
61This script comes from Serek:
62
63#!/bin/bash
4d732f7e 64xgettext --keyword=_ -keyword=N_ \
65 --default-domain=squirrelmail/po/squirrelmail \
66 -C squirrelmail/src/*.php
67xgettext --keyword=_ -keyword=N_ \
68 --default-domain=squirrelmail/po/squirrelmail \
69 -C -j squirrelmail/functions/*.php
7f029a23 70