Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] Re: (PR#3612) Legend bug
Home

[Freeciv-Dev] Re: (PR#3612) Legend bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ChrisK@xxxxxxxx, kersten@xxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3612) Legend bug
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 Mar 2003 09:57:02 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Ben Webb wrote:
> On Wed, Mar 05, 2003 at 04:59:34AM -0800, freeciv-dev-bounce@xxxxxxxxxxx 
> wrote:
> 
>>[jdorje - Wed Mar  5 01:22:01 2003]:
>>
>>>[ChrisK@xxxxxxxx - Tue Mar  4 22:13:38 2003]:
>>>
>>>
>>>>The legend translations existing in *.po are not shown in the nation
>>>>dialog.
>>>
>>>Oops.
>>>
>>>jason
>>
>>The following patch seems to do the trick.
> 
> +    pl->legend = _(mystrdup(p->legend));
> 
> Don't you mean
>      pl->legend = mystrdup(_(p->legend));
> ?
> 
> Your approach will throw away a pointer...

Where did you get this code?  My patch had it the second way...

Anyway, this patch should check for the empty string case.  Thanks for 
your help on that, Ben.

Another question: are the nation classes ever translated?  It doesn't 
look like it...

jason

Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.293
diff -u -r1.293 packhand.c
--- client/packhand.c   2003/02/20 23:00:55     1.293
+++ client/packhand.c   2003/03/05 17:54:39
@@ -2280,7 +2280,11 @@
     pl->class = mystrdup(_("Other"));
   }
 
-  pl->legend = mystrdup(p->legend);
+  if (p->legend[0] != '\0') {
+    pl->legend = mystrdup(_(p->legend));
+  } else {
+    pl->legend = mystrdup("");
+  }
 
   tilespec_setup_nation_flag(p->id);
 }

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