[Patch Preview] move module-init and locale setup from scm to C

Neil Williams linux at codehelp.co.uk
Wed Jan 11 05:56:04 EST 2006


On Wednesday 11 January 2006 10:31 am, Christian Stimming wrote:
> Neil Williams schrieb:
> > On Wednesday 11 January 2006 9:51 am, Christian Stimming wrote:
> >>is it just me or is this patch missing a setlocale(LC_ALL, ""); call,
> >>especially since that one will be commented out from main.acm? Apart
> >>from that it looks fine to me. I don't think ordering does matter there.
> >
> > I looked at that, but then I read about gtk_init():
> > gtk_set_locale () initializes internationalization support for GTK+.
> > gtk_init() automatically does this, so there is typically no point in
> > calling this function
> > http://developer.gnome.org/doc/API/2.0/gtk/gtk-General.html#gtk-set-local
> >e
> >
> > It appears we don't need any gettext stuff in the C.
>
> Err... no, that's not correct.

(good! I thought it had to be wrong!)

> gtk_init() as well as gtk_set_locale() 
> initializes internationalization support *for GTK+*. We still need to
> initialize i18n support *for gnucash*.

Confusing! All translated gnucash strings are presented through Gtk anyway 
(aren't they?). Initially, it seems a strange way of doing things. I would 
have expected Gtk to set it's locale at login but then I suppose that just 
shows my innocence in GUI programming!!! Getting Gtk confused with the window 
manager.
:-)

So using gtk_set_locale() and gtk_init() together loads the translated strings 
for Gtk elements and widgets that are not specifically within gnucash, e.g. 
where we call a standard dialogue or standard widgets within our own 
dialogues. gnucash then loads it's translated strings for the elements that 
we design ourselves and passes those to Gtk which combines our translated 
strings with it's own. Potentially, every dialogue loads translated strings 
from at least two separate translation files. No wonder GUI's are so 
demanding on resources!

> This is achieved by the four functions that we currently have -- the 3
> from Chris' patch plus setlocale(). Your previous post about
> setlocale(), which was identical to mine, was correct.

OK. I think I've got it straight now. Pity the Gtk API documentation didn't 
make it clear.
:-(

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20060111/4c6d2418/attachment.bin


More information about the gnucash-devel mailing list