windows issues with gettext

Dirk Hohndel dirk at
Mon Oct 15 13:25:08 PDT 2012

"Lubomir I. Ivanov" <neolit123 at> writes:
>>> what should be done here to make the menus work?
>> Is that all menue entries or just some? Is that with the latest master?
>> And current .mo files? The limited testing that I did on Win7 32bit
>> seemed to work - but I'm not 100% sure if I checked the menues or just
>> the program itself...
> it looks like all menu entries are affected, but not the dialogs such
> as "about", "open" and others.

Just to understand, this is with the environment variable
LANGUAGE="bg_BG.UTF-8" set prior to starting subsurface?

>>> -------
>>> 2) actually, how _are we_ going to translate subsurface on windows?
>>> currently subsurface is not translated on just has some
>>> translations for a posix library, which can be bundled, but are not
>>> active due to missing env. variables.
>>> a proposal
>>> - if the required env.variables are not available we set them by
>>> default to the system locale on runtime.
>>> to do that we use glib's g_win32_getlocale() which provides a method
>>> to translate the win32 locales into posix locales.
>>> - we instruct the user that he/she can set the subsurface language by
>>> adding / modifying the required env. variables.
>>> this is a bit cumbersome solution, considering most software i've seen
>>> can switch languages by a menu click.
>>> alternative ideas are welcome.
>> My plan was to use g_win32_getlocale to switch to the language that the
>> user is running Windows in. I looked around and almost no software I
>> could get my hands on allows switching language independent from the OS.
>> Sure, we could add a preference setting but that seems odd.
>> All I think we need for 2.1 is to have it work for the "normal" case,
>> i.e. use g_win32_getlocale and then setup the environment variables
>> ourselves (unless they are already set up).
> ok, i can send a patch later on for that.


>>> ------
>>> 3) i'm seeing a gettext bug on windows that seems to affect all
>>> translations. title of the "add dive" dialog has invalid UTF-8
>>> characters.
>> Is this a font problem? I.e., which character is supposed to be there in
>> your locale and does that glyph exist in the font that you are using?
> seems that the strings are truncated for all languages in the dialog:
> fr -> Plo
> de -> Tau
> bg -> It shows some odd characters + the pango message (which is also
> due to truncation)
> font is the default "Sans" on win32.

Ahh, this is not a font problem - the code used there appears buggy. 
It modifies memory that it shouldn't modify. I'll push out a fix in a

>>> i'm having some troubles switching my locale on the linux distros i
>>> have. so i can't confirm the same there.
>>> "Locale not supported by C library."
>> Which locale are you trying? I assume this is Ubuntu?
> i've tried most locales with LANG and LANGUAGE (LC_ALL is locked).
> i think that i actually have to compile the .mo files for linux first!

Yes, you need .mo files. But running make on Linux should do that for
you (in the ./locale folder).

For me LANG="de_DE.UTF-8" works fine...


More information about the subsurface mailing list