locale and Qt

Hi,

when I set the locale to a value (let's say 'en_US.UTF-8' different
back to 'fr_FR.UTF-8' after the first figure is created when the
backend is dervied from Qt (no problem with Agg only).

Any idea how to prevent from that?

···

from my that of environement ('fr_FR'), it is automatically switched

--
Stephane Raynaud

Can you describe how you are changing the locale? It could be that Qt is reverting it to your system value every time a new figure window is created. Maybe you could set it somehow "deeper", like in an environment variable.

Cheers,
Mike

Stephane Raynaud wrote:

···

Hi,

when I set the locale to a value (let's say 'en_US.UTF-8' different
from my that of environement ('fr_FR'), it is automatically switched
back to 'fr_FR.UTF-8' after the first figure is created when the
backend is dervied from Qt (no problem with Agg only).

Any idea how to prevent from that?

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Can you describe how you are changing the locale? It could be that Qt
is reverting it to your system value every time a new figure window is
created. Maybe you could set it somehow "deeper", like in an
environment variable.

I simply perform a locale.setlocale(locale.LC_ALL, 'en_US.UTF-8').

A simple way to avoid this problem is to set the environement variable
at the same time :
os.environ['LANG'] = 'en_US.UTF-8'
but it's not a clean way.

I guess, a MPL solution would be to check if locale.getlocale()
returns something else than (None,None) at the beginning of
new_figure_manager() and to set it back at the end.

···

On Fri, Feb 29, 2008 at 2:52 PM, Michael Droettboom <mdroe@...86...> wrote:

Cheers,
Mike

Stephane Raynaud wrote:
> Hi,
>
> when I set the locale to a value (let's say 'en_US.UTF-8' different
> from my that of environement ('fr_FR'), it is automatically switched
> back to 'fr_FR.UTF-8' after the first figure is created when the
> backend is dervied from Qt (no problem with Agg only).
>
> Any idea how to prevent from that?
>

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

--
Stephane Raynaud