[Spambayes] As a donation, I propose to translate this soft in french

Tony Meyer tameyer at ihug.co.nz
Fri Aug 25 09:30:11 CEST 2006


> OK, is there only the file dialogs.rc in \languages\fr\DIALOGS  
> folder to modify? I saw some sentences in french and some in  
> english inside...

No, there are four translation tasks.  What follows is an abridged  
version of the instructions in README-DEVEL.txt - it is long, but it  
tries to explain what to do in enough detail that it can be done by  
someone who has never done any l18n before.  Please ask if you need  
help, or make suggestions if you can see ways to make these  
instructions more palatable.

Making a translation
====================

Translation is only feasible for 1.1 and above.  No translation  
effort is planned for the 1.0.x series of releases.

To translate, you will need:

   o A suitable version of Python (2.2 or greater) installed.
     See http://python.org/download

   o A copy of the SpamBayes source that you wish to translate.

   o Resourcepackage installed.
     See http://resourcepackage.sourceforge.net

  Optional tools that may make translation easier include:

   o A copy of VC++, Visual Studio, or some other GUI tool that allows
     editing of VC++ dialog resource files.
     (Visual Studio Express edition is freely available from Microsoft)

   o A GUI HTML editor.

   o A GUI gettext editor, such as poEdit.
     http://poedit.sourceforge.net

Translation Tasks
-----------------

There are four translation tasks:

   o Documentation.  This is the least exciting, but the most important.
     If the documentation is appropriately translated, then even if  
elements
     of the interface are not translated, users should be able to  
manage.

     A method of managing translated documents has yet to be  
created.  If you
     are interested in translating documentation, please contact
     spambayes-dev at python.org.

   o Outlook dialogs.  The majority of the Outlook plug-in interface is
     handled by a VC++/Visual Studio dialog resource file pair  
(dialogs.h
     and dialogs.rc).  The plug-in code then manipulates this to  
create the
     actual dialog.

     The easiest method of translating these dialogs is to use a tool  
like
     VC++ or Visual Studio.  Simply open the
     'Outlook2000\dialogs\resources\dialogs.rc' file, translate the  
dialog,
     and save the file as
     'spambayes\languages\{lang_code}\DIALOGS\dialogs.rc', where  
{lang_code}
     is the appropriate language code for the language you have  
translated
     into (e.g. 'en_UK', 'es', 'de_DE').  If you do not have a GUI  
tool to
     edit the dialogs, simply open the dialogs.rc file in a text editor,
     manually change the appropriate strings, and save the file as  
above.

     Once the dialogs are translated, you need to use the rc2py.py  
utility
     to create the i18n_dialogs.py file.  For example, in the
     'Outlook2000\dialogs\resources' directory:
      > rc2py.py {base}\spambayes\languages\de_DE\DIALOGS\dialogs.rc
         {base}\spambayes\languages\de_DE\DIALOGS\i18n_dialogs.py 1
     Where {base} is the directory that contains the spambayes  
package directory.
     This should create a 'i18n_dialogs.py' in the same directory as  
your
     translated dialogs.rc file - this is the file the the Outlook  
plug-in
    uses.

[It has been a long time, but I believe most of the French  
translation of dialogs.rc is done].

   o Web interface template file.  The majority of the web interface is
     created by dynamic use of a HTML template file.

     The easiest method of translating this file is to use a GUI HTML  
editor.
     Simply open the 'spambayes/resources/ui.html' file, translate
     it as described within, and save the file as
     'spambayes/languages/{lang_code}/i18n.ui.html', where  
{lang_code} is
     the appropriate language code as described above.  If you do not  
have
     a GUI HTML editor, or are happy editing HTML by hand, simply use  
your
     favorite HTML editor to do this task.

     Once the template file is created, resourcepackage will  
automatically
     create the required ui_html.py file when SpamBayes is run with that
     language selected.

   o Gettext managed strings.  The remainder of both the Outlook plug-in
     and the web interface are contained within the various Python files
     that make up SpamBayes.  The Python gettext module (very similar to
     the GNU gettext system) is used to manage translation of these  
strings.

     To translate these strings, use the translation template
     'spambayes/languages/messages.pot'.  You can regenerate that  
file, if
     necessary, by running this command in the spambayes package  
directory:
       > {python dir}\tools\i18n\pygettext.py -o languages\messages.pot
         ..\contrib\*.py ..\Outlook2000\*.py ..\scripts\*.py *.py
         ..\testtools\*.py ..\utilities\*.py ..\windows\*.py

     You may wish to use a GUI system to create the required *.po file,
     such as poEdit, but you can also do this manually with a text  
editor.
     If your utility does not do it for you, you will also need to
     compile the .po file to a .mo file.  The utility msgfmt.py will do
     this for you - it should be located '{python dir}\tools\i18n'.

Testing the translation
-----------------------

There are two ways to set the language that SpamBayes will use:

  o If you are using Windows, change the preferred Windows language  
using
    the Control Panel.

  o Set the '[globals] language' SpamBayes option to a list of the
    preferred language(s).

=Tony.Meyer


More information about the SpamBayes mailing list