Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2003:
[Freeciv-Dev] Re: (PR#7006) Re: [freeciv-i18n] header of the .po file pr
Home

[Freeciv-Dev] Re: (PR#7006) Re: [freeciv-i18n] header of the .po file pr

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7006) Re: [freeciv-i18n] header of the .po file printed on tech help
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Mon, 1 Dec 2003 09:24:21 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7006 >

On Mon, Dec 01, 2003 at 09:04:14AM -0800, Jason Short wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7006 >
> 
> Raimar Falke wrote:
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=7006 >
> > 
> > On Sun, Nov 30, 2003 at 02:58:21PM -0800, Christian Knoke wrote:
> > 
> >><URL: http://rt.freeciv.org/Ticket/Display.html?id=7006 >
> >>
> >>On Sun, Nov 30, 2003 at 09:03:07PM +0100, Genevieve Gracian wrote:
> >>
> >>>I recently noticed that the header of the .po file is printed in the
> >>>help screens about techs. I don't know if I messed up the fr.po of if
> >>>this is due to delta patch. Can other translators say to me if that also
> >>>happens for other languages ?
> >>
> >>Yes, it does (for de.po).
> >>
> >>Probably a soure code bug.
> > 
> > 
> > Yes. The helptext field is now (with delta) always defined. This
> > causes the existing checks in helpdata.c to be flawed. The empty
> > helptext ("") is translated causing the problems mentioned above.
> 
> I think it'd be easier to change the helptext field to NULL when 
> receiving it, if it's empty.

This would require changing 
  u->helptext = mystrdup(p->helptext);
to
  if(p->helptext[0]=='\0') {
    u->helptext = NULL;
 } else {
    u->helptext = mystrdup(p->helptext);
 }

I decided against this. Too much special casing.

> Or at least, the check should be
> 
>    if (helptext && helptext[0] != '\0') {
> 
> so that we won't have problems with this in future.

It is unlikely that this happens in the future.

Previously the helptext was a pointer in the packet. And packhand.c
made a pointer assignment.

Now the helptext is an array in the packet. And packhand.c makes a
copy of it.

All pointer in packets got removed because it is fishy who owns the
data. Also now all data is inside the packet struct. No external
references.

> > Index: client/gui-gtk/helpdlg.c
> > ===================================================================
> > RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/helpdlg.c,v
> > retrieving revision 1.63
> > diff -u -u -r1.63 helpdlg.c
> > --- client/gui-gtk/helpdlg.c        2003/04/04 15:47:46     1.63
> > +++ client/gui-gtk/helpdlg.c        2003/12/01 07:45:06
> > @@ -816,10 +816,6 @@
> >      gtk_widget_show_all(help_tree_buttons_hbox);
> >  
> >      helptext_tech(buf, i, pitem->text);
> > -    if (advances[i].helptext) {
> > -      if (strlen(buf)) strcat(buf, "\n");
> > -      sprintf(buf+strlen(buf), "%s\n", _(advances[i].helptext));
> > -    }
> >      wordwrap_string(buf, 68);
> >  
> >      w = gtk_label_new(buf);
> 
> Why do you remove this part?

This code part was moved into the helptext_tech function. It is there
also for all other helptext_* functions.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  One nuclear bomb can ruin your whole day.




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