X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=doc%2Ftranslating.txt;h=b74bace35accd3551d46515775f9e7fb62d4cf12;hp=5f26e1ade2dc91a1de8cf192e8eff79b7daa890e;hb=59927db317c6b031765a88ca3508edeb7ccbcc6e;hpb=1e63b43003a372f5b420d5696ccb54ff45bd7972 diff --git a/doc/translating.txt b/doc/translating.txt index 5f26e1ad..b74bace3 100644 --- a/doc/translating.txt +++ b/doc/translating.txt @@ -1,14 +1,14 @@ How to translate SquirrelMail into another language? ==================================================== -This document does not deal with CVS and how to upload translations to +This document does not deal with Subversion and how to upload translations to the repository. 1. First time translation ------------------------- a) You must have gettext installed. If it is not installed you can - download the soources from + download the sources from . b) Find the language code for the language you are going to translate @@ -17,20 +17,30 @@ b) Find the language code for the language you are going to translate there is a 2 letter code for the language, use this. Create a directory squirrelmail/locale/language_code/LC_MESSAGES/. - Copy squirrelmail/po/squirrelmail.po into this directory. This is the - file that is going to be translated. + Copy squirrelmail/po/squirrelmail.pot into this directory and rename + it to squirrelmail.po. This is the file that is going to be translated. c) To translate the actual strings fill in the msgstr after each - msgid with the appropiate translation. There are a few tools which + msgid with the appropriate translation. There are a few tools which can make this job a bit easier at - . + . Convert the translated squirrelmail.po into a binary file by running the command "msgfmt -o squirrelmail.mo squirrelmail.po" in the directory where the translated squirrelmail.po is residing. -d) Add the language name and language code to the array at the top of - squirrelmail/functions/i18n.php. +d) Create locale/language_code/setup.php file with your translation description. + For example locale/tlh/setup.php + + + Before SquirrelMail 1.5.1 translation description should be added to + functions/i18n.php. Sample uses only required settings. Translation + description can use other advanced settings. Check include/i18n.php + or SquirrelMail developer's manual. There is also a small script in the po/ directory that can help in creating charset mappings from the mappings files that are provided by @@ -44,30 +54,30 @@ strings that are already translated are no longer used and new strings are added. Therefore it is necessary to maintain the translations. a) There should always be an updated template containing all strings - in SquirrelMail in squirrelmail/squirrelmail.po. To merge all new + in SquirrelMail in squirrelmail/po/squirrelmail.pot. To merge all new strings in this file into an existing translation run the command msgmerge squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po \ -squirrelmail/po/squirrelmail.po > \ +squirrelmail/po/squirrelmail.pot > \ squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po.new This should keep all strings that are unchanged and comment out all strings that are no longer in use. You might want to make a copy before doing this. -b) Rung msgfmt again to create a new binary file. +SquirrelMail contains po/mergepo script that can merge strings without need +to write that complex msgmerge command. Just put your translation name as +option. + +b) Run msgfmt again to create a new binary file. 3. Updating the template ------------------------ -This script comes from Serek: +SquirrelMail provides po/xgetpo script that extracts all the required +strings and updates po/squirrelmail.pot file. + -#!/bin/bash -xgettext --keyword=_ -keyword=N_ \ - --default-domain=squirrelmail/po/squirrelmail \ - -C squirrelmail/src/*.php -xgettext --keyword=_ -keyword=N_ \ - --default-domain=squirrelmail/po/squirrelmail \ - -C -j squirrelmail/functions/*.php +$ Id: $