translating.txt 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. How to translate SquirrelMail into another language?
  2. ====================================================
  3. This document does not deal with CVS and how to upload translations to
  4. the repository.
  5. 1. First time translation
  6. -------------------------
  7. a) You must have gettext installed. If it is not installed you can
  8. download the sources from
  9. <URL:ftp://ftp.gnu.org/pub/gnu/gettext/>.
  10. b) Find the language code for the language you are going to translate
  11. into. A list of language codes can be found at
  12. <URL:http://lcweb.loc.gov/standards/iso639-2/langhome.html>. If
  13. there is a 2 letter code for the language, use this.
  14. Create a directory squirrelmail/locale/language_code/LC_MESSAGES/.
  15. Copy squirrelmail/po/squirrelmail.po into this directory. This is the
  16. file that is going to be translated.
  17. c) To translate the actual strings fill in the msgstr after each
  18. msgid with the appropriate translation. There are a few tools which
  19. can make this job a bit easier at
  20. <URL:http://i18n.kde.org/translation-howto/gui-specialized-apps.html>.
  21. Convert the translated squirrelmail.po into a binary file by
  22. running the command "msgfmt -o squirrelmail.mo squirrelmail.po" in
  23. the directory where the translated squirrelmail.po is residing.
  24. d) Add the language name and language code to the array at the top of
  25. squirrelmail/functions/i18n.php.
  26. There is also a small script in the po/ directory that can help in
  27. creating charset mappings from the mappings files that are provided by
  28. the Unicode consortium.
  29. 2. Maintaining translations
  30. ---------------------------
  31. The text strings in the program will change over time. This means that
  32. strings that are already translated are no longer used and new strings
  33. are added. Therefore it is necessary to maintain the translations.
  34. a) There should always be an updated template containing all strings
  35. in SquirrelMail in squirrelmail/squirrelmail.po. To merge all new
  36. strings in this file into an existing translation run the command
  37. msgmerge squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po \
  38. squirrelmail/po/squirrelmail.po > \
  39. squirrelmail/locale/language/LC_MESSAGES/squirrelmail.po.new
  40. This should keep all strings that are unchanged and comment out all
  41. strings that are no longer in use. You might want to make a copy
  42. before doing this.
  43. b) Run msgfmt again to create a new binary file.
  44. 3. Updating the template
  45. ------------------------
  46. This script comes from Serek:
  47. #!/bin/bash
  48. xgettext --keyword=_ -keyword=N_ \
  49. --default-domain=squirrelmail/po/squirrelmail \
  50. -C squirrelmail/src/*.php
  51. xgettext --keyword=_ -keyword=N_ \
  52. --default-domain=squirrelmail/po/squirrelmail \
  53. -C -j squirrelmail/functions/*.php
  54. $ Id $