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

Here's the S2_2 patch to convert the 55 remaining "%s's" to "the %s" and use
the nation_adjective instead of the player->name.  For 2.1, I'll massage the
po files, too.  It is rather tedious.  Hold off working on translations for
today until I can get this done....


Index: server/citytools.c
===================================================================
--- server/citytools.c  (revision 14202)
+++ server/citytools.c  (working copy)
@@ -502,8 +502,8 @@
   struct player *to_player = city_owner(tocity);
 
   if (from_player == to_player) {
-    freelog(LOG_VERBOSE, "Changed homecity of %s's %s to %s",
-           from_player->name,
+    freelog(LOG_VERBOSE, "Changed homecity of %s %s to %s",
+           nation_rule_name(nation_of_player(from_player)),
            unit_rule_name(punit),
            tocity->name);
     if (verbose) {
@@ -518,33 +518,40 @@
       freelog(LOG_VERBOSE, "Transfered %s in %s from %s to %s",
              unit_rule_name(punit),
              in_city->name,
-             from_player->name, to_player->name);
+             nation_rule_name(nation_of_player(from_player)),
+             nation_rule_name(nation_of_player(to_player)));
       if (verbose) {
        notify_player(from_player, punit->tile, E_UNIT_RELOCATED,
                      _("Transfered %s in %s from %s to %s."),
                      unit_name_translation(punit),
                      in_city->name,
-                     from_player->name, to_player->name);
+                     nation_adjective_for_player(from_player),
+                     nation_adjective_for_player(to_player));
       }
     } else if (can_unit_exist_at_tile(punit, tocity->tile)) {
       freelog(LOG_VERBOSE, "Transfered %s from %s to %s",
              unit_rule_name(punit),
-             from_player->name, to_player->name);
+             nation_rule_name(nation_of_player(from_player)),
+             nation_rule_name(nation_of_player(to_player)));
       if (verbose) {
        notify_player(from_player, punit->tile, E_UNIT_RELOCATED,
                      _("Transfered %s from %s to %s."),
                      unit_name_translation(punit),
-                     from_player->name, to_player->name);
+                     nation_adjective_for_player(from_player),
+                     nation_adjective_for_player(to_player));
       }
     } else {
       freelog(LOG_VERBOSE, "Could not transfer %s from %s to %s",
              unit_rule_name(punit),
-             from_player->name, to_player->name);
+             nation_rule_name(nation_of_player(from_player)),
+             nation_rule_name(nation_of_player(to_player)));
       if (verbose) {
        notify_player(from_player, punit->tile, E_UNIT_LOST,
-                     _("%s from %s lost in transfer to %s's %s"),
+                     _("%s %s lost in transfer to %s %s"),
+                     nation_adjective_for_player(from_player),
                      unit_name_translation(punit),
-                     from_player->name, to_player->name, tocity->name);
+                     nation_adjective_for_player(to_player),
+                     tocity->name);
       }
       wipe_unit(punit);
       return;
@@ -615,10 +622,11 @@
     } else {
       /* The unit is lost.  Call notify_player (in all other cases it is
        * called automatically). */
-      freelog(LOG_VERBOSE, "Lost %s's %s at (%d,%d) when %s was lost.",
-             unit_owner(vunit)->name,
+      freelog(LOG_VERBOSE, "Lost %s %s at (%d,%d) when %s was lost.",
+             nation_rule_name(nation_of_unit(vunit)),
              unit_rule_name(vunit),
-             vunit->tile->x, vunit->tile->y, pcity->name);
+             TILE_XY(vunit->tile),
+             pcity->name);
       if (verbose) {
        notify_player(unit_owner(vunit), vunit->tile,
                         E_UNIT_LOST,
Index: server/settlers.c
===================================================================
--- server/settlers.c   (revision 14202)
+++ server/settlers.c   (working copy)
@@ -1263,8 +1263,9 @@
            || unit_has_type_flag(punit, F_CITIES))
        && !unit_has_orders(punit)
         && punit->moves_left > 0) {
-      freelog(LOG_DEBUG, "%s's settler at (%d, %d) is ai controlled.",
-             pplayer->name, TILE_XY(punit->tile)); 
+      freelog(LOG_DEBUG, "%s settler at (%d, %d) is ai controlled.",
+             nation_rule_name(nation_of_player(pplayer)),
+             TILE_XY(punit->tile)); 
       if (punit->activity == ACTIVITY_SENTRY) {
        handle_unit_activity_request(punit, ACTIVITY_IDLE);
       }
@@ -1278,8 +1279,9 @@
   } unit_list_iterate_safe_end;
 
   if (timer_in_use(t)) {
-    freelog(LOG_VERBOSE, "%s's autosettlers consumed %g milliseconds.",
-           pplayer->name, 1000.0*read_timer_seconds(t));
+    freelog(LOG_VERBOSE, "%s autosettlers consumed %g milliseconds.",
+           nation_rule_name(nation_of_player(pplayer)),
+           1000.0*read_timer_seconds(t));
   }
 }
 
Index: server/cityturn.c
===================================================================
--- server/cityturn.c   (revision 14202)
+++ server/cityturn.c   (working copy)
@@ -948,8 +948,8 @@
     /* There *was* something in the worklist, but it's empty now.  Bug the
        player about it. */
     notify_player(pplayer, pcity->tile, E_WORKLIST,
-                    _("%s's worklist is now empty."),
-                    pcity->name);
+                 _("The %s worklist is now empty."),
+                 pcity->name);
   }
 
   return success;
@@ -1285,8 +1285,8 @@
                       API_TYPE_UNIT_TYPE, utype,
                       API_TYPE_CITY, pcity,
                       API_TYPE_STRING, "unavailable");
-    freelog(LOG_VERBOSE, "%s's %s tried to build %s, which is not available.",
-            pplayer->name,
+    freelog(LOG_VERBOSE, "%s %s tried to build %s, which is not available.",
+            nation_rule_name(nation_of_city(pcity)),
             pcity->name,
             utype_rule_name(utype));
     return TRUE;
Index: server/maphand.c
===================================================================
--- server/maphand.c    (revision 14202)
+++ server/maphand.c    (working copy)
@@ -1606,10 +1606,10 @@
        if (can_unit_exist_at_tile(punit, ptile2)
            && !is_non_allied_unit_tile(ptile2, unit_owner(punit))) {
          freelog(LOG_VERBOSE,
-                 "Moved %s's %s due to changing terrain at (%d,%d).",
-                 unit_owner(punit)->name,
+                 "Moved %s %s due to changing terrain at (%d,%d).",
+                 nation_rule_name(nation_of_unit(punit)),
                  unit_rule_name(punit),
-                 punit->tile->x, punit->tile->y);
+                 TILE_XY(punit->tile));
          notify_player(unit_owner(punit),
                           punit->tile, E_UNIT_RELOCATED,
                           _("Moved your %s due to changing terrain."),
@@ -1624,10 +1624,10 @@
       if (unit_alive && punit->tile == ptile) {
        /* if we get here we could not move punit */
        freelog(LOG_VERBOSE,
-               "Disbanded %s's %s due to changing land to sea at (%d,%d).",
-               unit_owner(punit)->name,
+               "Disbanded %s %s due to changing land to sea at (%d,%d).",
+               nation_rule_name(nation_of_unit(punit)),
                unit_rule_name(punit),
-               punit->tile->x, punit->tile->y);
+               TILE_XY(punit->tile));
        notify_player(unit_owner(punit),
                         punit->tile, E_UNIT_LOST,
                         _("Disbanded your %s due to changing terrain."),
@@ -1930,8 +1930,10 @@
         max_range *= max_range; /* we are dealing with square distances */
         /* Transfer tile to city if closer than current source */
         if (r_curr > r_city && max_range >= r_city) {
-          freelog(LOG_DEBUG, "%s's %s(%d,%d) acquired tile (%d,%d) from "
-                  "(%d,%d)", tile_owner(ptile)->name, pcity->name,
+          freelog(LOG_DEBUG, "%s %s(%d,%d) acquired tile (%d,%d) from "
+                  "(%d,%d)",
+                  nation_rule_name(nation_of_player(tile_owner(ptile))),
+                  pcity->name,
                   TILE_XY(pcity->tile),
                   TILE_XY(ptile),
                   TILE_XY(ptile->owner_source));
Index: server/diplhand.c
===================================================================
--- server/diplhand.c   (revision 14202)
+++ server/diplhand.c   (working copy)
@@ -404,16 +404,16 @@
       case CLAUSE_MAP:
        give_map_from_player_to_player(pgiver, pdest);
        notify_player(pdest, NULL, E_DIPLOMACY,
-                     _("You receive %s's worldmap."),
-                     pgiver->name);
+                     _("You receive the %s worldmap."),
+                     nation_adjective_for_player(pgiver));
 
         worker_refresh_required = TRUE; /* See CLAUSE_VISION */
        break;
       case CLAUSE_SEAMAP:
        give_seamap_from_player_to_player(pgiver, pdest);
        notify_player(pdest, NULL, E_DIPLOMACY,
-                     _("You receive %s's seamap."),
-                     pgiver->name);
+                     _("You receive the %s seamap."),
+                     nation_adjective_for_player(pgiver));
 
         worker_refresh_required = TRUE; /* See CLAUSE_VISION */
        break;
@@ -466,23 +466,27 @@
        pdest->diplstates[player_index(pgiver)].max_state = 
           MAX(DS_PEACE, pdest->diplstates[player_index(pgiver)].max_state);
        notify_player(pgiver, NULL, E_TREATY_PEACE,
-                     PL_("You agree on an armistice with %s. In %d turn "
-                         "it will turn into a peace treaty. Move your "
-                         "units out of %s's territory.",
-                         "You agree on an armistice with %s. In %d turns "
-                         "it will turn into a peace treaty. Move your "
-                         "units out of %s's territory.",
+                     PL_("You agree on an armistice with the %s. In %d turn, "
+                         "it will become a peace treaty. Move your "
+                         "units out of %s territory.",
+                         "You agree on an armistice with the %s. In %d turns, "
+                         "it will become a peace treaty. Move your "
+                         "units out of %s territory.",
                          TURNS_LEFT),
-                     pdest->name, TURNS_LEFT, pdest->name);
+                     nation_plural_for_player(pdest),
+                     TURNS_LEFT,
+                     nation_adjective_for_player(pdest));
        notify_player(pdest, NULL, E_TREATY_PEACE,
-                     PL_("You agree on an armistice with %s. In %d turn "
-                         "it will turn into a peace treaty. Move your "
-                         "units out of %s's territory.",
-                         "You agree on an armistice with %s. In %d turns "
-                         "it will turn into a peace treaty. Move your "
-                         "units out of %s's territory.",
+                     PL_("You agree on an armistice with the %s. In %d turn, "
+                         "it will become a peace treaty. Move your "
+                         "units out of %s territory.",
+                         "You agree on an armistice with the %s. In %d turns, "
+                         "it will become a peace treaty. Move your "
+                         "units out of %s territory.",
                          TURNS_LEFT),
-                     pgiver->name, TURNS_LEFT, pgiver->name);
+                     nation_plural_for_player(pgiver),
+                     TURNS_LEFT,
+                     nation_adjective_for_player(pgiver));
        if (old_diplstate == DS_ALLIANCE) {
          update_players_after_alliance_breakup(pgiver, pdest);
        }
Index: server/diplomats.c
===================================================================
--- server/diplomats.c  (revision 14202)
+++ server/diplomats.c  (working copy)
@@ -330,9 +330,9 @@
   /* If unit has too few hp, can't sabotage. */
   if (pvictim->hp < 2) {
     notify_player(pplayer, pvictim->tile, E_MY_DIPLOMAT_FAILED,
-                    _("Your %s could not sabotage %s's %s."),
+                    _("Your %s could not sabotage the %s %s."),
                     unit_name_translation(pdiplomat),
-                    unit_owner(pvictim)->name,
+                    nation_adjective_for_player(uplayer),
                     unit_name_translation(pvictim));
     freelog (LOG_DEBUG, "sabotage-unit: unit has too few hit points");
     return;
@@ -352,15 +352,15 @@
 
   /* Notify everybody involved. */
   notify_player(pplayer, pvictim->tile, E_MY_DIPLOMAT_SABOTAGE,
-                  _("Your %s succeeded in sabotaging %s's %s."),
+                  _("Your %s succeeded in sabotaging the %s %s."),
                   unit_name_translation(pdiplomat),
-                  unit_owner(pvictim)->name,
+                  nation_adjective_for_player(uplayer),
                   unit_name_translation(pvictim));
   notify_player(uplayer, pvictim->tile,
                   E_ENEMY_DIPLOMAT_SABOTAGE,
-                  _("Your %s was sabotaged by %s!"),
+                  _("Your %s was sabotaged by the %s!"),
                   unit_name_translation(pvictim),
-                  pplayer->name);
+                  nation_plural_for_player(pplayer));
 
   /* this may cause a diplomatic incident */
   maybe_cause_incident(SPY_SABOTAGE_UNIT, pplayer, pvictim, NULL);
@@ -419,8 +419,8 @@
     notify_player(pplayer, pdiplomat->tile,
                     E_MY_DIPLOMAT_FAILED,
                     _("You don't have enough gold to"
-                      " bribe %s's %s."),
-                    unit_owner(pvictim)->name,
+                      " bribe the %s %s."),
+                    nation_adjective_for_player(uplayer),
                     unit_name_translation(pvictim));
     freelog (LOG_DEBUG, "bribe-unit: not enough gold");
     return;
@@ -428,7 +428,7 @@
 
   if (unit_has_type_flag(pvictim, F_UNBRIBABLE)) {
     notify_player(pplayer, pdiplomat->tile, E_MY_DIPLOMAT_FAILED,
-                    _("You cannot bribe %s!"),
+                    _("You cannot bribe the %s!"),
                     unit_name_translation(pvictim));
     return;
   }
@@ -603,8 +603,8 @@
                       pcity->name);
     }
     notify_player(cplayer, pcity->tile, E_ENEMY_DIPLOMAT_FAILED,
-                    _("%s's %s failed to steal technology from %s."),
-                    pplayer->name,
+                    _("%s %s failed to steal technology from %s."),
+                    nation_adjective_for_player(pplayer),
                     unit_name_translation(pdiplomat),
                     pcity->name);
     /* this may cause a diplomatic incident */
@@ -1238,8 +1238,8 @@
     case DIPLOMAT_BRIBE:
       notify_player(offender, victim_tile, E_DIPLOMATIC_INCIDENT,
                       _("You have caused an incident while bribing "
-                        "%s's %s."),
-                      victim_player->name,
+                        "the %s %s."),
+                      nation_adjective_for_player(victim_player),
                       unit_name_translation(victim_unit));
       notify_player(victim_player, victim_tile, E_DIPLOMATIC_INCIDENT,
                       _("%s has caused an incident while bribing "
Index: server/unittools.c
===================================================================
--- server/unittools.c  (revision 14202)
+++ server/unittools.c  (working copy)
@@ -1035,10 +1035,11 @@
   struct tile *src_tile = punit->tile, *dst_tile = pcity->tile;
 
   if (city_owner(pcity) == unit_owner(punit)){
-    freelog(LOG_VERBOSE, "Teleported %s's %s from (%d, %d) to %s",
-           unit_owner(punit)->name,
+    freelog(LOG_VERBOSE, "Teleported %s %s from (%d,%d) to %s",
+           nation_rule_name(nation_of_unit(punit)),
            unit_rule_name(punit),
-           src_tile->x, src_tile->y, pcity->name);
+           TILE_XY(src_tile),
+           pcity->name);
     if (verbose) {
       notify_player(unit_owner(punit), pcity->tile, E_UNIT_RELOCATED,
                       _("Teleported your %s to %s."),
@@ -1673,13 +1674,13 @@
        } else {
          assert(other_killed[i] != punit);
          notify_player(player_by_number(i), punit->tile, E_UNIT_LOST,
-                       /* TRANS: "Cannon lost when John's Destroyer
-                        * attacked Mark's Musketeers." */
-                       _("%s lost when %s's %s attacked %s's %s."),
+                       /* TRANS: "Cannon lost when the Polish Destroyer
+                        * attacked the German Musketeers." */
+                       _("%s lost when the %s %s attacked the %s %s."),
                        unit_name_translation(other_killed[i]),
-                       pvictor->name,
+                       nation_adjective_for_player(pvictor),
                        unit_name_translation(pkiller),
-                       pvictim->name,
+                       nation_adjective_for_player(pvictim),
                        unit_name_translation(punit));
        }
       } else if (num_killed[i] > 1) {
@@ -1689,38 +1690,38 @@
          if (others == 1) {
            notify_player(player_by_number(i), punit->tile, E_UNIT_LOST,
                          /* TRANS: "Musketeers (and Cannon) lost to an
-                          * attack from John's Destroyer." */
-                         _("%s (and %s) lost to an attack from %s's %s."),
+                          * attack from the Polish Destroyer." */
+                         _("%s (and %s) lost to an attack from the %s %s."),
                          unit_name_translation(punit),
                          unit_name_translation(other_killed[i]),
-                         pvictor->name,
+                         nation_adjective_for_player(pvictor),
                          unit_name_translation(pkiller));
          } else {
            notify_player(player_by_number(i), punit->tile, E_UNIT_LOST,
                          /* TRANS: "Musketeers and 3 other units lost to
-                          * an attack from John's Destroyer." (only happens
-                          * with at least 2 other units) */
+                          * an attack from the Polish Destroyer."
+                          * (only happens with at least 2 other units) */
                          PL_("%s and %d other unit lost to an attack "
-                             "from %s's %s.",
+                             "from the %s %s.",
                              "%s and %d other units lost to an attack "
-                             "from %s's %s.", others),
+                             "from the %s %s.", others),
                          unit_name_translation(punit),
                          others,
-                         pvictor->name,
+                         nation_adjective_for_player(pvictor),
                          unit_name_translation(pkiller));
          }
        } else {
          notify_player(player_by_number(i), punit->tile, E_UNIT_LOST,
-                       /* TRANS: "2 units lost when John's Destroyer
-                        * attacked Mark's Musketeers."  (only happens
-                        * with at least 2 other units) */
-                       PL_("%d unit lost when %s's %s attacked %s's %s.",
-                           "%d units lost when %s's %s attacked %s's %s.",
+                       /* TRANS: "2 units lost when the Polish Destroyer
+                        * attacked the German Musketeers."
+                        * (only happens with at least 2 other units) */
+                       PL_("%d unit lost when the %s %s attacked the %s %s.",
+                           "%d units lost when the %s %s attacked the %s %s.",
                            num_killed[i]),
                        num_killed[i],
-                       pvictor->name,
+                       nation_adjective_for_player(pvictor),
                        unit_name_translation(pkiller),
-                       pvictim->name,
+                       nation_adjective_for_player(pvictim),
                        unit_name_translation(punit));
        }
       }
@@ -1975,31 +1976,32 @@
 
   unit_list_iterate_safe(ptile->units, punit) {
     notify_player(unit_owner(punit), ptile, E_UNIT_LOST,
-                    _("Your %s was nuked by %s."),
-                    unit_name_translation(punit),
-                    pplayer == unit_owner(punit) ? _("yourself") : 
pplayer->name);
+                 _("Your %s was nuked by %s."),
+                 unit_name_translation(punit),
+                 pplayer == unit_owner(punit)
+                 ? _("yourself")
+                 : nation_plural_for_player(pplayer));
     if (unit_owner(punit) != pplayer) {
-      notify_player(pplayer,
-                      ptile, E_UNIT_WIN,
-                      _("%s's %s was nuked."),
-                      unit_owner(punit)->name,
-                      unit_name_translation(punit));
+      notify_player(pplayer, ptile, E_UNIT_WIN,
+                   _("The %s %s was nuked."),
+                   nation_adjective_for_player(unit_owner(punit)),
+                   unit_name_translation(punit));
     }
     wipe_unit(punit);
   } unit_list_iterate_safe_end;
 
   if (pcity) {
-    notify_player(city_owner(pcity),
-                    ptile, E_CITY_NUKED,
-                    _("%s was nuked by %s."),
-                    pcity->name,
-                    pplayer == city_owner(pcity) ? _("yourself") : 
pplayer->name);
+    notify_player(city_owner(pcity), ptile, E_CITY_NUKED,
+                 _("%s was nuked by %s."),
+                 pcity->name,
+                 pplayer == city_owner(pcity)
+                 ? _("yourself")
+                 : nation_plural_for_player(pplayer));
 
     if (city_owner(pcity) != pplayer) {
-      notify_player(pplayer,
-                      ptile, E_CITY_NUKED,
-                      _("You nuked %s."),
-                      pcity->name);
+      notify_player(pplayer, ptile, E_CITY_NUKED,
+                   _("You nuked %s."),
+                   pcity->name);
     }
 
     city_reduce_size(pcity, pcity->size / 2);
Index: server/unithand.c
===================================================================
--- server/unithand.c   (revision 14202)
+++ server/unithand.c   (working copy)
@@ -812,33 +812,33 @@
 **************************************************************************/
 static void handle_unit_attack_request(struct unit *punit, struct unit 
*pdefender)
 {
-  struct player *pplayer = unit_owner(punit);
   struct unit *plooser, *pwinner;
   struct city *pcity;
   int moves_used, def_moves_used; 
-  struct tile *def_tile = pdefender->tile;
   int old_unit_vet, old_defender_vet, vet;
   int winner_id;
+  struct tile *def_tile = pdefender->tile;
+  struct player *pplayer = unit_owner(punit);
   
-  freelog(LOG_DEBUG, "Start attack: %s's %s against %s's %s.",
-         pplayer->name,
+  freelog(LOG_DEBUG, "Start attack: %s %s against %s %s.",
+         nation_rule_name(nation_of_player(pplayer)),
          unit_rule_name(punit), 
-         unit_owner(pdefender)->name,
+         nation_rule_name(nation_of_unit(pdefender)),
          unit_rule_name(pdefender));
 
   /* Sanity checks */
-  if (pplayers_non_attack(unit_owner(punit), unit_owner(pdefender))) {
+  if (pplayers_non_attack(pplayer, unit_owner(pdefender))) {
     die("Trying to attack a unit with which you have peace "
        "or cease-fire at %i, %i", TILE_XY(def_tile));
   }
-  if (pplayers_allied(unit_owner(punit), unit_owner(pdefender))
+  if (pplayers_allied(pplayer, unit_owner(pdefender))
       && !(unit_has_type_flag(punit, F_NUCLEAR) && punit == pdefender)) {
     die("Trying to attack a unit with which you have alliance at %i, %i",
        TILE_XY(def_tile));
   }
 
   if (unit_has_type_flag(punit, F_NUCLEAR)) {
-    if ((pcity = sdi_try_defend(unit_owner(punit), def_tile))) {
+    if ((pcity = sdi_try_defend(pplayer, def_tile))) {
       notify_player(pplayer, punit->tile, E_UNIT_LOST_ATT,
                       _("Your Nuclear missile was shot down by"
                         " SDI defences, what a waste."));
@@ -948,8 +948,7 @@
    * capturing (or destroying) a city. */
 
   if (pwinner == punit && myrand(100) < game.info.occupychance &&
-      !is_non_allied_unit_tile(def_tile,
-                              unit_owner(punit))) {
+      !is_non_allied_unit_tile(def_tile, pplayer)) {
 
     /* Hack: make sure the unit has enough moves_left for the move to succeed,
        and adjust moves_left to afterward (if successful). */
Index: server/stdinhand.c
===================================================================
--- server/stdinhand.c  (revision 14202)
+++ server/stdinhand.c  (working copy)
@@ -2366,13 +2366,13 @@
     unit_list_iterate(ptile->units, punit) {
       if (punit->debug) {
         punit->debug = FALSE;
-        cmd_reply(CMD_DEBUG, caller, C_OK, _("%s's %s no longer debugged."),
-                  unit_owner(punit)->name,
+        cmd_reply(CMD_DEBUG, caller, C_OK, _("%s %s no longer debugged."),
+                  nation_adjective_for_player(unit_owner(punit)),
                   unit_name_translation(punit));
       } else {
         punit->debug = TRUE;
-        UNIT_LOG(LOG_NORMAL, punit, _("%s's %s debugged."),
-                 unit_owner(punit)->name,
+        UNIT_LOG(LOG_NORMAL, punit, _("%s %s debugged."),
+                 nation_adjective_for_player(unit_owner(punit)),
                  unit_name_translation(punit));
       }
     } unit_list_iterate_end;
@@ -2405,13 +2405,13 @@
     }
     if (punit->debug) {
       punit->debug = FALSE;
-      cmd_reply(CMD_DEBUG, caller, C_OK, _("%s's %s no longer debugged."),
-                unit_owner(punit)->name,
+      cmd_reply(CMD_DEBUG, caller, C_OK, _("%s %s no longer debugged."),
+                nation_adjective_for_player(unit_owner(punit)),
                 unit_name_translation(punit));
     } else {
       punit->debug = TRUE;
-      UNIT_LOG(LOG_NORMAL, punit, _("%s's %s debugged."),
-               unit_owner(punit)->name,
+      UNIT_LOG(LOG_NORMAL, punit, _("%s %s debugged."),
+               nation_adjective_for_player(unit_owner(punit)),
                unit_name_translation(punit));
     }
   } else {
Index: server/savegame.c
===================================================================
--- server/savegame.c   (revision 14202)
+++ server/savegame.c   (working copy)
@@ -4087,10 +4087,11 @@
             && pplayers_allied(plr, aplayer)
             && pplayer_can_make_treaty(plr, aplayer, DS_ALLIANCE) 
                == DIPL_ALLIANCE_PROBLEM) {
-          /* TRANS: Minor error message. */
+          /* TRANS: ... <Danish> alliance to <Poles>.... */
           freelog(LOG_ERROR, _("Illegal alliance structure detected: "
-                  "%s's alliance to %s reduced to peace treaty."),
-                  plr->name, aplayer->name);
+                  "%s alliance to %s reduced to peace treaty."),
+                  nation_adjective_for_player(plr),
+                  nation_plural_for_player(aplayer));
           plr->diplstates[player_index(aplayer)].type = DS_PEACE;
           aplayer->diplstates[player_index(plr)].type = DS_PEACE;
         }
@@ -4178,8 +4179,8 @@
       struct unit *ferry = game_find_unit_by_number(punit->transported_by);
 
       if (!ferry && !can_unit_exist_at_tile(punit, punit->tile)) {
-        freelog(LOG_ERROR, "Removing %s's unferried %s in %s at (%d, %d)",
-                pplayer->name,
+        freelog(LOG_ERROR, "Removing %s unferried %s in %s at (%d, %d)",
+                nation_rule_name(nation_of_player(pplayer)),
                 unit_rule_name(punit),
                 terrain_rule_name(punit->tile->terrain),
                 TILE_XY(punit->tile));
Index: server/plrhand.c
===================================================================
--- server/plrhand.c    (revision 14202)
+++ server/plrhand.c    (working copy)
@@ -1695,8 +1695,9 @@
   /* Now split the empire */
 
   freelog(LOG_VERBOSE,
-         "%s's nation is thrust into civil war, created AI player %s",
-         pplayer->name, cplayer->name);
+         "%s nation is thrust into civil war, created AI player %s",
+         nation_rule_name(nation_of_player(pplayer)),
+         cplayer->name);
   notify_player(pplayer, NULL, E_CIVIL_WAR,
                   _("Your nation is thrust into civil war, "
                     " %s is declared the leader of the rebel states."),
@@ -1732,13 +1733,14 @@
   resolve_unit_stacks(pplayer, cplayer, FALSE);
 
   notify_player(NULL, NULL, E_CIVIL_WAR,
-               _("The capture of %s's capital and the destruction "
+               _("Capture of the %s capital and destruction "
                  "of the empire's administrative\n"
-                 "      structures have sparked a civil war.  "
+                 "      structures has sparked a civil war.  "
                  "Opportunists have flocked to the rebel cause,\n"
                  "      and the upstart %s now holds power in %d "
                  "rebel provinces."),
-               pplayer->name, cplayer->name,
+               nation_adjective_for_player(pplayer),
+               cplayer->name,
                city_list_size(cplayer->cities));
 }  
 
Index: common/combat.c
===================================================================
--- common/combat.c     (revision 14202)
+++ common/combat.c     (working copy)
@@ -605,16 +605,15 @@
   if (unit_list_size(ptile->units) > 0 && !bestdef) {
     struct unit *punit = unit_list_get(ptile->units, 0);
 
-    freelog(LOG_ERROR, "get_defender bug: %s's %s vs %s's %s (total %d"
+    freelog(LOG_ERROR, "get_defender bug: %s %s vs %s %s (total %d"
             " units) on \"%s\" at (%d,%d). ",
-            unit_owner(attacker)->name,
+            nation_rule_name(nation_of_unit(attacker)),
             unit_rule_name(attacker),
-            unit_owner(punit)->name,
+            nation_rule_name(nation_of_unit(punit)),
             unit_rule_name(punit),
             unit_list_size(ptile->units), 
             terrain_rule_name(tile_terrain(ptile)),
-            ptile->x,
-            ptile->y);
+            TILE_XY(ptile));
   }
 
   return bestdef;
Index: ai/aitools.c
===================================================================
--- ai/aitools.c        (revision 14202)
+++ ai/aitools.c        (working copy)
@@ -375,12 +375,11 @@
     if (find_air_first_destination(punit, &waypoint_tile)) {
       return waypoint_tile;
     } else {
-      struct player *pplayer = unit_owner(punit);
-
       freelog(LOG_VERBOSE, "Did not find an air-route for "
-             "%s's %s at (%d, %d) -> (%d, %d)",
-             pplayer->name,
+             "%s %s[%d] (%d,%d)->(%d,%d)",
+             nation_rule_name(nation_of_unit(punit)),
              unit_rule_name(punit),
+             punit->id,
              TILE_XY(punit->tile),
              TILE_XY(dest_tile));
       /* Prevent take off */
Index: ai/aicity.c
===================================================================
--- ai/aicity.c (revision 14202)
+++ ai/aicity.c (working copy)
@@ -1793,7 +1793,7 @@
     bool is_valid;
 
     if (acity && acity != pcity && city_owner(acity) == city_owner(pcity))  {
-      freelog(LOG_DEBUG, "%s taking over %s's square in (%d, %d)",
+      freelog(LOG_DEBUG, "%s taking over %s square in (%d, %d)",
               pcity->name, acity->name, ptile->x, ptile->y);
       is_valid = map_to_city_map(&city_map_x, &city_map_y, acity, ptile);
       assert(is_valid);
Index: ai/aidiplomat.c
===================================================================
--- ai/aidiplomat.c     (revision 14202)
+++ ai/aidiplomat.c     (working copy)
@@ -281,9 +281,10 @@
   handle_unit_activity_request(punit, ACTIVITY_IDLE);
 
 #define T(my_act,my_val)                                            \
-  if (diplomat_can_do_action(punit, my_act, ctarget->tile)) {      \
-    freelog(LOG_DIPLOMAT, "Player %s's diplomat %d does " #my_act   \
-            " on %s", pplayer->name, punit->id, ctarget->name);     \
+  if (diplomat_can_do_action(punit, my_act, ctarget->tile)) {       \
+    freelog(LOG_DIPLOMAT, "%s %s[%d] does " #my_act " at %s",       \
+            nation_rule_name(nation_of_unit(punit)),                \
+            unit_rule_name(punit), punit->id, ctarget->name);       \
     handle_unit_diplomat_action(pplayer, punit->id,                 \
                                 ctarget->id, my_val, my_act);       \
     return;                                                         \
Index: ai/ailog.c
===================================================================
--- ai/ailog.c  (revision 14202)
+++ ai/ailog.c  (working copy)
@@ -117,7 +117,7 @@
 
 /**************************************************************************
   Log city messages, they will appear like this
-    2: c's Romenna(5,35) [s1 d106 u11 g1] must have Archers ...
+    2: Polish Romenna(5,35) [s1 d106 u11 g1] must have Archers ...
 **************************************************************************/
 void CITY_LOG(int level, const struct city *pcity, const char *msg, ...)
 {
@@ -132,9 +132,10 @@
     return;
   }
 
-  my_snprintf(buffer, sizeof(buffer), "%s's %s(%d,%d) [s%d d%d u%d g%d] ",
-              city_owner(pcity)->name, pcity->name,
-              pcity->tile->x, pcity->tile->y, pcity->size,
+  my_snprintf(buffer, sizeof(buffer), "%s %s(%d,%d) [s%d d%d u%d g%d] ",
+              nation_rule_name(nation_of_city(pcity)),
+              pcity->name,
+              TILE_XY(pcity->tile), pcity->size,
               pcity->ai.danger, pcity->ai.urgency,
               pcity->ai.grave_danger);
 
@@ -151,7 +152,7 @@
 
 /**************************************************************************
   Log unit messages, they will appear like this
-    2: c's Archers[139] (5,35)->(0,0){0,0} stays to defend city
+    2: Polish Archers[139] (5,35)->(0,0){0,0} stays to defend city
   where [] is unit id, ()->() are coordinates present and goto, and
   {,} contains bodyguard and ferryboat ids.
 **************************************************************************/
@@ -189,12 +190,12 @@
   }
   
   my_snprintf(buffer, sizeof(buffer),
-             "%s's %s[%d] (%s) (%d,%d)->(%d,%d){%d,%d} ",
-              unit_owner(punit)->name,
+             "%s %s[%d] %s (%d,%d)->(%d,%d){%d,%d} ",
+              nation_rule_name(nation_of_unit(punit)),
               unit_rule_name(punit),
               punit->id,
              get_activity_text(punit->activity),
-             punit->tile->x, punit->tile->y,
+             TILE_XY(punit->tile),
              gx, gy,
               punit->ai.bodyguard, punit->ai.ferryboat);
 
@@ -211,7 +212,7 @@
 
 /**************************************************************************
   Log message for bodyguards. They will appear like this
-    2: ai4's bodyguard Mech. Inf.[485] (38,22){Riflemen:[EMAIL PROTECTED],23} 
was ...
+    2: Polish Mech. Inf.[485] bodyguard (38,22){Riflemen:[EMAIL PROTECTED],23} 
was ...
   note that these messages are likely to wrap if long.
 **************************************************************************/
 void BODYGUARD_LOG(int level, const struct unit *punit, const char *msg)
@@ -250,11 +251,12 @@
   /* else perhaps the charge died */
 
   my_snprintf(buffer, sizeof(buffer),
-              "%s's %s %s[%d] (%d,%d){%s:[EMAIL PROTECTED],%d} ",
-              unit_owner(punit)->name,
+              "%s %s[%d] %s (%d,%d){%s:[EMAIL PROTECTED],%d} ",
+              nation_rule_name(nation_of_unit(punit)),
+              unit_rule_name(punit),
+              punit->id,
               type,
-              unit_rule_name(punit),
-              punit->id, punit->tile->x, punit->tile->y,
+              TILE_XY(punit->tile),
              s, id, charge_x, charge_y);
   cat_snprintf(buffer, sizeof(buffer), msg);
   if (punit->debug) {
Index: ai/aihunt.c
===================================================================
--- ai/aihunt.c (revision 14202)
+++ ai/aihunt.c (working copy)
@@ -439,11 +439,12 @@
       } else {
         dist1 = dist2 = 0;
       }
-      UNIT_LOG(LOGLEVEL_HUNT, punit, "considering chasing %s(%d, %d) id %d "
+      UNIT_LOG(LOGLEVEL_HUNT, punit, "considering chasing %s[%d](%d, %d) "
                "dist1 %d dist2 %d",
               unit_rule_name(target),
+               target->id,
               TILE_XY(target->tile),
-               target->id, dist1, dist2);
+               dist1, dist2);
 
       /* We can't chase if we aren't faster or on intercept vector */
       if (unit_type(punit)->move_rate < unit_type(target)->move_rate
@@ -479,12 +480,12 @@
         continue; /* Not worth it */
       }
 
-      UNIT_LOG(LOGLEVEL_HUNT, punit, "hunting %s's %s(%d, %d) "
-               "id %d with want %d, dist1 %d, dist2 %d", 
-               unit_owner(target)->name,
+      UNIT_LOG(LOGLEVEL_HUNT, punit, "hunting %s %s[%d](%d,%d) "
+               "with want %d, dist1 %d, dist2 %d", 
+               nation_rule_name(nation_of_unit(target)),
                unit_rule_name(target), 
+               target->id,
                TILE_XY(target->tile),
-               target->id,
                stackthreat,
                dist1,
                dist2);
Index: ai/aiunit.c
===================================================================
--- ai/aiunit.c (revision 14202)
+++ ai/aiunit.c (working copy)
@@ -1828,8 +1828,11 @@
 
   /* if we're not there yet, and we can move, move. */
   if (!same_pos(pcity->tile, punit->tile) && punit->moves_left != 0) {
-    freelog(LOG_CARAVAN, "%s's caravan %d going to %s in %s",
-            pplayer->name, punit->id,
+    freelog(LOG_CARAVAN, "%s %s[%d](%d,%d) going to %s in %s",
+            nation_rule_name(nation_of_unit(punit)),
+            unit_rule_name(punit),
+            punit->id,
+            TILE_XY(punit->tile),
             help_wonder ? "help a wonder" : "trade", pcity->name);
     alive = ai_unit_goto(punit, pcity->tile); 
   }
@@ -1842,16 +1845,23 @@
          * Instead, we want to aggregate enough caravans to build instantly.
          * -AJS, 990704
          */
-      freelog(LOG_CARAVAN, "%s's caravan %d helps build wonder in %s",
-          pplayer->name, punit->id, pcity->name);
+      freelog(LOG_CARAVAN, "%s %s[%d](%d,%d) helps build wonder in %s",
+              nation_rule_name(nation_of_unit(punit)),
+              unit_rule_name(punit),
+              punit->id,
+              TILE_XY(punit->tile),
+              pcity->name);
        handle_unit_help_build_wonder(pplayer, punit->id);
     } else {
-      freelog(LOG_CARAVAN, "%s's caravan %d creates trade route in %s",
-          pplayer->name, punit->id, pcity->name);
+      freelog(LOG_CARAVAN, "%s %s[%d](%d,%d) creates trade route in %s",
+              nation_rule_name(nation_of_unit(punit)),
+              unit_rule_name(punit),
+              punit->id,
+              TILE_XY(punit->tile),
+              pcity->name);
       handle_unit_establish_trade(pplayer, punit->id);
-             }
-  } else {
-           }
+    }
+  }
 }
 
 /*************************************************************************
@@ -1863,8 +1873,12 @@
 {
   const struct unit *caravan = data;
 
-  freelog(LOG_CARAVAN2, "%s caravan %d(%s): %s %s worth %g",
-         unit_owner(caravan)->name, caravan->id, result->src->name,
+  freelog(LOG_CARAVAN2, "%s %s[%d](%d,%d) %s: %s %s worth %g",
+         nation_rule_name(nation_of_unit(caravan)),
+          unit_rule_name(caravan),
+          caravan->id,
+          TILE_XY(caravan->tile),
+         result->src->name,
          result->help_wonder ? "wonder in" : "trade to",
          result->dest->name, result->value);
 }
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to