bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Changing language for GUI


From: Jim Segrave
Subject: Re: [Bug-gnubg] Changing language for GUI
Date: Mon, 25 Aug 2003 15:02:44 +0200
User-agent: Mutt/1.4i

On Mon 25 Aug 2003 (00:28 +0200), Holger wrote:
> Hi all,
> 
> I've made quite some attempts to change the used language for the GTK+
> version on Windows programmatically. Nothing seemed to help.
> 
> First the situation: If the locale folder hierarchy is set up properly
> gnubg starts up on Windows with the language set in Windows preferences |
> Country preferences (in German Systemsteuerung | L?ndereinstellungen). If
> the environment variable LANG is set, this overrides the Windows setting
> and gnubg uses this language.
> 
> I haven't tried it with the CLI version, for this setlocale( LC_ALL,
> "it_IT" ) might be enough. But for GTK+ it isn't.
> Finally, in order to try whether it would work at all I've put the
> following hack instead of
>     setlocale (LC_ALL, "");
> at the beginning of real_main:
> 
>     SetEnvironmentVariable( "LANG", "it_IT" );

Try putenv(), that's available under mingw.

I've a crude hack which allows a command line flag -l (or --lang) to
be followed by a LANG environment variable:

gnubg --lang de_DE.ISO8859-15
gnubg --lang it_IT.ISO8859-15
gnubg --lang en_US.ISO8859-1

Will take a currently UK English version and display it in
German/Italian/US English (mostly checker)

This should work under Windows as well.
It would be nice if this could be parsed out of the command file, but
the command file handling doesn't begin until after gtk has been
started. 

Note that the weird processing of some arguments before setting up gtk
and some after means this does not work for text mode.

It's not clear to me why we process some command line arguments, then
set up the GUI (if required), then process the rest of the command
line. I suspect this is historical and that all the arguments could be
processed before GTK and the GUI start up, in which case my fix would
also work for text mode.


-- 
Jim Segrave           address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]