Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] (PR#13759) PL_ in science_dialog_text
Home

[Freeciv-Dev] (PR#13759) PL_ in science_dialog_text

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13759) PL_ in science_dialog_text
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Aug 2005 08:42:45 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13759 >

Egor points out that the PL_ is incomplete.

-jason

Index: client/text.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/text.c,v
retrieving revision 1.48
diff -p -u -r1.48 text.c
--- client/text.c       22 Aug 2005 17:57:20 -0000      1.48
+++ client/text.c       24 Aug 2005 15:33:10 -0000
@@ -374,10 +374,10 @@ static int get_bulbs_per_turn(int *pours
 ****************************************************************************/
 const char *science_dialog_text(void)
 {
-  int turns_to_advance;
   struct player *plr = game.player_ptr;
   int ours, theirs;
   static struct astring str = ASTRING_INIT;
+  char ourbuf[1024] = "", theirbuf[1024] = "";
 
   astr_clear(&str);
 
@@ -389,29 +389,25 @@ const char *science_dialog_text(void)
   }
   assert(ours >= 0 && theirs >= 0);
   if (get_player_research(plr)->researching == A_UNSET) {
-    if (theirs == 0) {
-      astr_add(&str, _("Progress: no research target (%d pts/turn)"), ours);
-    } else {
-      astr_add(&str, _("Progress: no research target "
-           "(%d pts/turn, %d pts/turn from team)"), ours, theirs);
-    }
-    return str.str;
-  }
-  turns_to_advance = (total_bulbs_required(plr) + ours + theirs - 1)
-                     / (ours + theirs);
-  if (theirs == 0) {
-    /* Simple version, no techpool */
-    astr_add(&str, PL_("Progress: %d turn/advance (%d pts/turn)",
-           "Progress: %d turns/advance (%d pts/turn)",
-           turns_to_advance), turns_to_advance, ours);
+    astr_add(&str, _("Progress: no research target"));
   } else {
+    int turns_to_advance = ((total_bulbs_required(plr) + ours + theirs - 1)
+                           / (ours + theirs));
+
+    astr_add(&str, PL_("Progress: %d turn/advance",
+                      "Progress: %d turns/advance",
+                      turns_to_advance), turns_to_advance);
+  }
+  my_snprintf(ourbuf, sizeof(ourbuf),
+             PL_("%d bulb/turn", "%d bulbs/turn", ours), ours);
+  if (theirs > 0) {
     /* Techpool version */
-    astr_add(&str, PL_("Progress: %d turn/advance (%d pts/turn, "
-           "%d pts/turn from team)",
-           "Progress: %d turns/advance (%d pts/turn, "
-           "%d pts/turn from team)",
-           turns_to_advance), turns_to_advance, ours, theirs);
+    /* TRANS: This is appended to "%d bulb/turn" text */
+    my_snprintf(theirbuf, sizeof(theirbuf),
+               PL_(", %d bulb/turn from team",
+                   ", %d bulbs/turn from team", theirs), theirs);
   }
+  astr_add(&str, " (%s%s)", ourbuf, theirbuf);
   return str.str;
 }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13759) PL_ in science_dialog_text, Jason Short <=