Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2001:
[Freeciv-Dev] Re: [FreeCiv-Cvs] thue: Fix bug in menu handling. Fixes (P
Home

[Freeciv-Dev] Re: [FreeCiv-Cvs] thue: Fix bug in menu handling. Fixes (P

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [FreeCiv-Cvs] thue: Fix bug in menu handling. Fixes (PR#821) repo...
From: Thue <thue@xxxxxxx>
Date: Fri, 29 Jun 2001 14:26:46 +0200

On Friday 29 June 2001 12:17, Christian Knoke wrote:
> Am Donnerstag, 28. Juni 2001 22:21 schrieben Sie:
> > This is an automated notification of a change to freeciv cvs,
> > on Thu Jun 28 13:13:14 PDT 2001 = Thu Jun 28 20:13:14 2001 (GMT)
> > by Thue Janus Kristensen <thue@xxxxxxx>
> >
> > ---- Files affected:
> >
> > freeciv/client/gui-gtk menu.c
> >
> > ---- Log message:
> >
> > Fix bug in menu handling.
> >
> > Fixes (PR#821) reported by Christian Knoke <ChrisK@xxxxxxxx>
>
> Well, this is/was the newer part of the bug. As I wrote,
> there is an older one, and it's still there. :-(
>
> Within the _german_ version, still two items are active
> in pregame phase and shouldn't. They are:
>
> Server Opt initial == Serveroptionen zur Spielgenerierung ansehen
> Server Opt ongoing == Andere Serveroptionen ansehen
>
> The debug 3 messages of the client are:
>
> 3: Can't set sensitivity for non-existent menu <main>/Spiel/Lokale
> Einstellungen speichern. 3: Can't set sensitivity for non-existent
> menu <main>/Spiel/Serveroptionen zur Spielgenerierung ansehen. 3:
> Can't set sensitivity for non-existent menu <main>/Spiel/Andere
> Serveroptionen ansehen. 3: Can't set sensitivity for non-existent
> menu <main>/Spiel/Verbindung zum Server trennen.
>
> Regards,
> Christian

Ok, I think I understand what happens here.
Strings like
    menus_set_sensitive("<main>/Game/Server Opt initial", TRUE);
are translated via
    translate_menu_path()
and the translated version is then used for a lookup in the gtk menus 
via
    gtk_item_factory_get_widget()

gtk_item_factory_get_widget() and menus_set_sensitive() wants the 
strings without the underscores used for keyboard accelerators. But 
since the strings without underscores are not marked for translation 
translate_menu_path() will not be able to find them.
But by accident the strings without underscores exist in the xaw and 
mui clients, so gettext will get a correct string back, and everything 
will work.
One little but is that it will not work if the mui and xaw menu items 
are named differently from the gtk ones. This is what happens in 
Christian's bug report.

Solution: It seems clear to me that the gtk client should not depend on 
the other clients to mark strings for it. So a solution is that we
1) include the underscores in the strings passed through 
menus_set_sensitive() to translate_menu_path()
2) use gettext on the item with underscores, and then remove the 
underscores before we return the result from translate_menu_path().

-Thue


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