windows issues with gettext

Lubomir I. Ivanov neolit123 at gmail.com
Mon Oct 15 13:09:13 PDT 2012


On 15 October 2012 22:59, Dirk Hohndel <dirk at hohndel.org> wrote:
> "Lubomir I. Ivanov" <neolit123 at gmail.com> writes:
>
>> here is the list of problems of subsurface on windows.
>> there was a little bit of discussion in the other thread but nothing
>> very constructive, so lets bring these again.
>> ideas are welcome...
>>
>> -------
>> 1) i can't seem to get the menus translated on win32:
>>
>> gettext is using env. variables (only?) so we have to take that into
>> consideration.
>>
>> set LC_ALL=xx_XX.UTF-8  -> no effect
>> set LANG=xx_XX.UTF-8  -> no effect
>> set LANGUAGE=xx_XX.UTF-8  -> translates everything but the menus
>> trying different translations -> no effect
>>
>> 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.

>> -------
>> 2) actually, how _are we_ going to translate subsurface on windows?
>> currently subsurface is not translated on windows...it 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.
>> http://i50.tinypic.com/fc8xhh.png
>
> 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.

>> 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!

lubomir
--


More information about the subsurface mailing list