[Bf-committers] Fixed garlic's setenv problem on windows

Sergey I. Sharybin g.ulairi at gmail.com
Tue Sep 6 09:13:08 CEST 2011

xiangquan xiao wrote:
> Just use gettext_putenv() instead of BLI_setenv().
> Now running blender.exe could change languages freely.
That's how it worked before and how it works in some other apps i've 
> But it's strange I got errors below on linux when opening the User
> Preference:
> X Error of failed request:  BadMatch (invalid parameter attributes)
>    Major opcode of failed request:  155 (GLX)
>    Minor opcode of failed request:  11 (X_GLXSwapBuffers)
>    Serial number of failed request:  5414
>    Current serial number in output stream:  5415
> Maybe it's just my system's fault I think.
This happens for me after `apt-get upgrade` when mesa libs are updating. 
I have to re-install nvidia driver after this.
> ============
> About the instant-update of language, we have discussed on IRC. We thought
> the existing notifier cannot change language instantly because the string
> pointers should change. e.g.
> The old _("good") points to "好", while the new _("good") points to "Bonne"
> So we think it OK to force users to restart, as language switch will happen
> rarely.
> ============
I think for first time it's ok. And probably we can write operators/ui 
re-register function (something like scripts reload operator).
Another solution is to make gettext on-display call. But there are some 
issues with this:
- Strings for translation can't be collected automatically
- It'll make draw code slower.
Don't think instant language change worth it.
> Then if we cannot get rid of setenv, then so be it.
I've checked gettext documentation and some sample applications where 
gettext is used and in each case when translation to non-system locale 
was needed, it was the same trick with environment variables. It's just 
how gettext works.

We can get rid of this, but it'll require re-writting gettext which i 
don't think worth this.

What's the problem with environment variables (after latest Xaio's fix 
for windows)?

With best regards, Sergey I. Sharybin

More information about the Bf-committers mailing list