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

On 3/11/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
> On 7/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > #: client/text.c:176 client/gui-sdl/mapview.c:626
> > msgid " with "
> >
> > This string needs a translator comment at the least, but it is also
> > buggy: sentences of any sort should not be split up like this, they
> > should be produced with e.g. "%s with %s" (and translator-commented) so
> > that we can move the with to be somewhere else as well if needed.
>
>  This patch improves this particular case a bit.

 - End part appears also when building gui-sdl mapview building list
(code currently not in use)


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-sdl/mapview.c freeciv/client/gui-sdl/mapview.c
--- freeciv/client/gui-sdl/mapview.c	2007-03-12 10:23:02.000000000 +0200
+++ freeciv/client/gui-sdl/mapview.c	2007-03-14 13:28:28.000000000 +0200
@@ -777,36 +777,41 @@
             	  
 	    citywall = city_got_citywalls(pTile->city);
                           
-#if 0                          
+#if 0       
+            /* This has hardcoded assumption that EFT_LAND_REGEN is always
+             * provided by *building* named *Barracks*. Similar assumptions for
+             * other effects. */     
 	    if (pplayers_allied(game.player_ptr, pOwner)) {
 	      barrack = (get_city_bonus(pTile->city, EFT_LAND_REGEN) > 0);
 	      airport = (get_city_bonus(pTile->city, EFT_AIR_VETERAN) > 0);
 	      port = (get_city_bonus(pTile->city, EFT_SEA_VETERAN) > 0);
 	    }
-	  
+
 	    if (citywall || barrack || airport || port) {
-	      cat_snprintf(buffer, sizeof(buffer), _(" with "));
+	      cat_snprintf(buffer, sizeof(buffer), Q_("?blistbegin: with "));
 	      if (barrack) {
                 cat_snprintf(buffer, sizeof(buffer), _("Barracks"));
 	        if (port || airport || citywall) {
-	          cat_snprintf(buffer, sizeof(buffer), ", ");
+	          cat_snprintf(buffer, sizeof(buffer), Q_("?blistmore:, "));
 	        }
 	      }
 	      if (port) {
 	        cat_snprintf(buffer, sizeof(buffer), _("Port"));
 	        if (airport || citywall) {
-	          cat_snprintf(buffer, sizeof(buffer), ", ");
+	          cat_snprintf(buffer, sizeof(buffer), Q_("?blistmore:, "));
 	        }
 	      }
 	      if (airport) {
 	        cat_snprintf(buffer, sizeof(buffer), _("Airport"));
 	        if (citywall) {
-	          cat_snprintf(buffer, sizeof(buffer), ", ");
+	          cat_snprintf(buffer, sizeof(buffer), Q_("?blistmore:, "));
 	        }
 	      }
 	      if (citywall) {
 	        cat_snprintf(buffer, sizeof(buffer), _("City Walls"));
               }
+
+              cat_snprintf(buffer, sizeof(buffer), Q_("?blistend:"));
 	    }
 #endif
 	    
diff -Nurd -X.diff_ignore freeciv/client/text.c freeciv/client/text.c
--- freeciv/client/text.c	2007-03-05 21:12:22.000000000 +0200
+++ freeciv/client/text.c	2007-03-14 13:27:16.000000000 +0200
@@ -142,6 +142,7 @@
      * borders are in use). */
     struct player *owner = city_owner(pcity);
     bool has_improvements = FALSE;
+    int prev_impr = B_LAST;
 
     if (!game.player_ptr || owner == game.player_ptr){
       /* TRANS: "City: Warsaw (Polish)" */
@@ -170,17 +171,29 @@
     impr_type_iterate(i) {
       if (is_improvement_visible(i) && city_got_building(pcity, i)) {
 	/* TRANS: previous lines gave other information about the city. */
-	if (has_improvements) {
-	  astr_add(&str, ", ");
-	} else {
-	  astr_add(&str, _(" with "));
-	}
-
-	astr_add(&str, get_improvement_name(i));
-	has_improvements = TRUE;
+        if (prev_impr != B_LAST) {
+          if (has_improvements) {
+            astr_add(&str, Q_("?blistmore:, "));
+          }
+          astr_add(&str, get_improvement_name(prev_impr));
+          has_improvements = TRUE;
+        } else {
+          astr_add(&str, Q_("?blistbegin: with "));
+        }
+        prev_impr = i;
       }
     } impr_type_iterate_end;
 
+    if (prev_impr != B_LAST) {
+      if (has_improvements) {
+        /* More than one improvement */
+        /* TRANS: This does not appear if there is only one building in the list */
+        astr_add(&str, Q_("?blistlast: and "));
+      }
+      astr_add(&str, get_improvement_name(prev_impr));
+      astr_add(&str, Q_("?blistend:"));
+    }
+
     unit_list_iterate(get_units_in_focus(), pfocus_unit) {
       struct city *hcity = find_city_by_id(pfocus_unit->homecity);
 
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to