[ghemical-devel] [ghemical-users] Translate Ghemical

Jean Bréfort jean.brefort at normalesup.org
Fri Aug 29 06:17:47 EDT 2008


Le vendredi 29 août 2008 à 12:25 +0300, Tommi Hassinen a écrit :
> From: Jean Bréfort [jean.brefort at normalesup.org]
> Sent: Friday, August 29, 2008 11:30 AM
> To: Tommi Hassinen
> Cc: Vlado Peshov; ghemical-devel at bioinformatics.org
> Subject: RE: [ghemical-devel] [ghemical-users] Translate Ghemical
> 
> Just one question before starting: does ghemical/libghemical always use
> glib (which have macros making things easier), I never played with that
> without glib. Quicly reading configure.ac, seems that libghemical don't
> use at all and ghemical only uses if built with gtk+ support.
> 
> 
> Hello.
> 
> First about ghemical : it is designed to be a portable application, and it's good to try to keep it that way. Some time in the past I even had a win32-api-version of ghemical, but I have seen that I don't have enough time for keeping multiple versions of ghemical floating around. So now it's gtk+ only and that's enough because gtk+ is ported to windows (works fine I have tested that myself) and to Macs too (haven't tested this yet). But in ghemical, all source files with names gtk_* are gtk+ related and it's safe to use glib there. These files also contain code for the most visible GUI elements so it's natural to start there. For the rest of the source files, I just need to figure out something. I will probably add a "translator" class and force all texts go through it before displaying them ; then it can be either translated (if glib is available) or passed through as it is (in English).

OK, so we can ise the glib things, great :-)

Attached a preliminary patch. You'll need to run intltoolize --force
before autoconf, automake and autoheader to make it work.

In the po directory, running "intltool-update -p" will generate
ghemical.pot that you can rename to any .po file, e.g.:
mv ghemical.pot fi.po

You also need a po/LINGUAS file listing all supported locales (one per
line). The one in gchemutils is currently:

# please keep this list sorted alphabetically
#
de
es
fr
it
pl
pt_BR
ru
zh_CN


> Still getting everything translated takes time, because the text is now generated using "streams", for example like this:
> cout << "Hello my name is " << my_name << " and I live in " << my_country << "." << endl;

cout << _("Hello my name_is") << my_name << _(" and I live in ") << my_country << _(".") << endl;

would work too, just with more strings to translate.

> And this is poorly suitable for translation! The text must be generated (correct me if I'm wrong) in printf-style like this:
> printf("Hello my name is %s and I live in %s.", my_name, my_country);
> 
> And this is why the (complete) translation is going to take it's time : all texts must be converted to printf-style full sentences first, which then can be translated.
> 
> Then about libghemical : let's just leave it all into the future. The code in libghemical can display notice/warning/error dialogs and it can print information into the text log window. I will probably use the same solution in libghemical as for the non-gtk+ code in the ghemical application.

OK, I would have proposed the same thing.

> So in the beginning we could start the translation work from ghemical only.
> 
> Regards,
> Tommi
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ghemical-gettext.patch
Type: text/x-patch
Size: 2025 bytes
Desc: not available
Url : http://www.bioinformatics.org/pipermail/ghemical-devel/attachments/20080829/184b6abe/attachment.bin 


More information about the ghemical-devel mailing list