Author: jtn
Date: Tue Aug  4 11:17:13 2015
New Revision: 29319

URL: http://svn.gna.org/viewcvs/freeciv?rev=29319&view=rev
Log:
Sort out nationality in unit tooltips.
Add it to middle-click popup.
Fixes "RomaLesothoan people".

FIXME

Modified:
    branches/S2_5/client/text.c

Modified: branches/S2_5/client/text.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/text.c?rev=29319&r1=29318&r2=29319&view=diff
==============================================================================
--- branches/S2_5/client/text.c (original)
+++ branches/S2_5/client/text.c Tue Aug  4 11:17:13 2015
@@ -331,16 +331,26 @@
     if (!client_player() || owner == client_player()) {
       struct city *pcity = player_city_by_number(owner, punit->homecity);
 
-      if (pcity) {
-        /* TRANS: "Unit: <unit type> | <username>
-         * (<nation + team>, <homecity>)" */
-        astr_add_line(&str, _("Unit: %s | %s (%s, %s)"),
-                      utype_name_translation(ptype), username,
-                      nation, city_name(pcity));
-      } else {
-        /* TRANS: "Unit: <unit type> | <username> (<nation + team>)" */
-        astr_add_line(&str, _("Unit: %s | %s (%s)"),
-                      utype_name_translation(ptype), username, nation);
+      /* TRANS: "Unit: <unit type> | <username> (<nation + team>)" */
+      astr_add_line(&str, _("Unit: %s | %s (%s)"),
+                    utype_name_translation(ptype), username, nation);
+
+      if (game.info.citizen_nationality
+          && unit_nationality(punit) != unit_owner(punit)) {
+        if (pcity) {
+          /* TRANS: on own line immediately following \n, "from <city> |
+           * <nationality> people" */
+          astr_add_line(&str, _("from %s | %s people"), city_name(pcity),
+                        nation_adjective_for_player(unit_nationality(punit)));
+        } else {
+          /* TRANS: Nationality of the people comprising a unit, if
+           * different from owner. */
+          astr_add_line(&str, _("%s people"),
+                        nation_adjective_for_player(unit_nationality(punit)));
+        }
+      } else if (pcity) {
+        /* TRANS: on own line immediately following \n, ... <city> */
+        astr_add_line(&str, _("from %s"), city_name(pcity));
       }
     } else if (NULL != owner) {
       struct player_diplstate *ds = player_diplstate_get(client_player(),
@@ -585,6 +595,7 @@
 
 /****************************************************************************
   Returns the unit description.
+  Used in e.g. city report tooltips.
 
   FIXME: This function is not re-entrant because it returns a pointer to
   static data.
@@ -615,8 +626,9 @@
 
   if (pplayer == owner) {
     unit_upkeep_astr(punit, &str);
-  }
-  astr_add(&str, "\n");
+  } else {
+    astr_add(&str, "\n");
+  }
   unit_activity_astr(punit, &str);
 
   if (pcity) {
@@ -627,8 +639,10 @@
   }
   if (game.info.citizen_nationality) {
     if (nationality != NULL && owner != nationality) {
-      /* TRANS: Nationality of the soldiers in unit, can be different from 
owner. */
-      astr_add(&str, _("%s people"), nation_adjective_for_player(nationality));
+      /* TRANS: Nationality of the people comprising a unit, if
+       * different from owner. */
+      astr_add_line(&str, _("%s people"),
+                    nation_adjective_for_player(nationality));
     } else {
       astr_add(&str, "\n");
     }
@@ -1190,9 +1204,12 @@
 
       /* Line 5, nationality text */
       if (nationality != NULL && owner != nationality) {
-        astr_add(&str, _("%s people"), 
nation_adjective_for_player(nationality));
+        /* TRANS: Nationality of the people comprising a unit, if
+         * different from owner. */
+        astr_add_line(&str, _("%s people"),
+                      nation_adjective_for_player(nationality));
       } else {
-        astr_add(&str, " ");
+        astr_add_line(&str, " ");
       }
     }
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to