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

That turned out to be relatively easy to fix.  Send more reports!

Committed S2_1 release 13041.

Index: client/gui-xaw/repodlgs.c
===================================================================
--- client/gui-xaw/repodlgs.c   (revision 13039)
+++ client/gui-xaw/repodlgs.c   (working copy)
@@ -228,7 +228,7 @@
   if (research->researching == A_UNSET) {
     my_snprintf(current_text, sizeof(current_text),
                _("Researching %s: %d/%s"),
-               advances[A_NONE].name,
+               advance_name_translation(A_NONE),
                research->bulbs_researched,
                _("unknown"));
   } else {
@@ -242,19 +242,19 @@
   if (research->tech_goal == A_UNSET) {
     my_snprintf(goal_text, sizeof(goal_text),
                _("Goal: %s (%d steps)"),
-               advances[A_NONE].name,
+               advance_name_translation(A_NONE),
                0);
   } else {
     my_snprintf(goal_text, sizeof(goal_text),
                _("Goal: %s (%d steps)"),
-               advances[research->tech_goal].name,
+               advance_name_translation(research->tech_goal),
                num_unknown_techs_for_goal(game.player_ptr,
                                           research->tech_goal));
   }
   
   for(i=A_FIRST, j=0; i<game.control.num_tech_types; i++)
     if(get_invention(game.player_ptr, i)==TECH_KNOWN) {
-      tech_list_names_ptrs[j]=advances[i].name;
+      tech_list_names_ptrs[j]=advance_name_translation(i);
       j++;
     }
   tech_list_names_ptrs[j]=0;
@@ -340,7 +340,7 @@
   for(i=A_FIRST, flag=0; i<game.control.num_tech_types; i++)
     if(get_invention(game.player_ptr, i)==TECH_REACHABLE) {
       Widget entry=
-      XtVaCreateManagedWidget(advances[i].name, smeBSBObjectClass, 
+      XtVaCreateManagedWidget(advance_name_translation(i), smeBSBObjectClass, 
                              popupmenu, NULL);
       XtAddCallback(entry, XtNcallback, science_change_callback, 
                    (XtPointer) i); 
@@ -357,7 +357,7 @@
         && (num_unknown_techs_for_goal(game.player_ptr, i) < 11
            || i == research->tech_goal)) {
       Widget entry=
-      XtVaCreateManagedWidget(advances[i].name, smeBSBObjectClass, 
+      XtVaCreateManagedWidget(advance_name_translation(i), smeBSBObjectClass, 
                              goalmenu, NULL);
       XtAddCallback(entry, XtNcallback, science_goal_callback, 
                    (XtPointer) i); 
@@ -405,7 +405,7 @@
 
   XtVaGetValues(science_help_toggle, XtNstate, &b, NULL);
   if (b == TRUE) {
-    popup_help_dialog_typed(advances[to].name, HELP_TECH);
+    popup_help_dialog_typed(advance_name_translation(to), HELP_TECH);
   } else {
     dsend_packet_player_research(&aconnection, to);
   }
@@ -422,7 +422,7 @@
 
   XtVaGetValues(science_help_toggle, XtNstate, &b, NULL);
   if (b == TRUE) {
-    popup_help_dialog_typed(advances[to].name, HELP_TECH);
+    popup_help_dialog_typed(advance_name_translation(to), HELP_TECH);
   } else {
     dsend_packet_player_tech_goal(&aconnection, to);
   }
@@ -489,7 +489,7 @@
     if (research->researching == A_UNSET) {
       my_snprintf(text, sizeof(text),
                  _("Researching %s: %d/%s"),
-                 advances[A_NONE].name,
+                 advance_name_translation(A_NONE),
                  research->bulbs_researched,
                  _("unknown"));
     } else {
@@ -505,12 +505,12 @@
     if (research->tech_goal == A_UNSET) {
       my_snprintf(text, sizeof(text),
                  _("Goal: %s (%d steps)"),
-                 advances[A_NONE].name,
+                 advance_name_translation(A_NONE),
                  0);
     } else {
       my_snprintf(text, sizeof(text),
                  _("Goal: %s (%d steps)"),
-                 advances[research->tech_goal].name,
+                 advance_name_translation(research->tech_goal),
                  num_unknown_techs_for_goal(game.player_ptr,
                                             research->tech_goal));
     }
@@ -519,7 +519,7 @@
 
     for(i=A_FIRST, j=0; i<game.control.num_tech_types; i++)
       if(get_invention(game.player_ptr, i)==TECH_KNOWN) {
-       tech_list_names_ptrs[j]=advances[i].name;
+       tech_list_names_ptrs[j]=advance_name_translation(i);
        j++;
       }
     tech_list_names_ptrs[j]=0;
@@ -537,7 +537,7 @@
       for(i=A_FIRST, flag=0; i<game.control.num_tech_types; i++)
       if(get_invention(game.player_ptr, i)==TECH_REACHABLE) {
        Widget entry=
-         XtVaCreateManagedWidget(advances[i].name, smeBSBObjectClass, 
+         XtVaCreateManagedWidget(advance_name_translation(i), 
smeBSBObjectClass, 
                                  popupmenu, NULL);
        XtAddCallback(entry, XtNcallback, science_change_callback, 
                      (XtPointer) i); 
@@ -561,7 +561,7 @@
          && (num_unknown_techs_for_goal(game.player_ptr, i) < 11
              || i == research->tech_goal)) {
        Widget entry=
-         XtVaCreateManagedWidget(advances[i].name, smeBSBObjectClass, 
+         XtVaCreateManagedWidget(advance_name_translation(i), 
smeBSBObjectClass, 
                                  goalmenu, NULL);
        XtAddCallback(entry, XtNcallback, science_goal_callback, 
                      (XtPointer) i); 
Index: client/gui-xaw/diplomat_dialog.c
===================================================================
--- client/gui-xaw/diplomat_dialog.c    (revision 13039)
+++ client/gui-xaw/diplomat_dialog.c    (working copy)
@@ -400,7 +400,7 @@
          (get_invention(pplayer, i)==TECH_UNKNOWN || 
           get_invention(pplayer, i)==TECH_REACHABLE)) {
       
-        advances_can_steal[j] = advances[i].name;
+        advances_can_steal[j] = advance_name_translation(i);
         advance_type[j++] = i;
       }
     }
Index: client/gui-xaw/diplodlg.c
===================================================================
--- client/gui-xaw/diplodlg.c   (revision 13039)
+++ client/gui-xaw/diplodlg.c   (working copy)
@@ -254,7 +254,7 @@
            || get_invention(plr1, i) == TECH_REACHABLE)
         && tech_is_available(plr1, i)) {
       Widget entry=
-       XtVaCreateManagedWidget(advances[i].name, smeBSBObjectClass, 
+       XtVaCreateManagedWidget(advance_name_translation(i), smeBSBObjectClass, 
                                popupmenu, NULL);
       XtAddCallback(entry, XtNcallback, diplomacy_dialog_tech_callback,
                         INT_TO_XTPOINTER((plr0->player_no << 24) |
Index: client/gui-xaw/inteldlg.c
===================================================================
--- client/gui-xaw/inteldlg.c   (revision 13039)
+++ client/gui-xaw/inteldlg.c   (working copy)
@@ -266,10 +266,10 @@
   for(i=A_FIRST, j=0; i<game.control.num_tech_types; i++)
     if (get_invention(pdialog->pplayer, i) == TECH_KNOWN) {
       if(get_invention(game.player_ptr, i)==TECH_KNOWN) {
-       sz_strlcpy(tech_list_names[j], advances[i].name);
+       sz_strlcpy(tech_list_names[j], advance_name_translation(i));
       } else {
        my_snprintf(tech_list_names[j], sizeof(tech_list_names[j]),
-                   "%s*", advances[i].name);
+                   "%s*", advance_name_translation(i));
       }
       tech_list_names_ptrs[j]=tech_list_names[j];
       j++;
Index: client/gui-xaw/helpdlg.c
===================================================================
--- client/gui-xaw/helpdlg.c    (revision 13039)
+++ client/gui-xaw/helpdlg.c    (working copy)
@@ -280,7 +280,7 @@
   }
   
   my_snprintf(label, sizeof(label),
-             "%s:%d", advances[tech].name,
+             "%s:%d", advance_name_translation(tech),
              num_unknown_techs_for_goal(game.player_ptr, tech));
 
   if(parent) {
@@ -737,7 +737,7 @@
       xaw_set_label(help_improvement_req_data, _("(Never)"));
     } else {
       xaw_set_label(help_improvement_req_data,
-                   advances[imp->tech_req].name);
+                   advance_name_translation(imp->tech_req));
     }*/
     
     /* FIXME: this should show ranges and all the MAX_NUM_REQS reqs. 
@@ -787,7 +787,7 @@
       xaw_set_label(help_improvement_req_data, _("(Never)"));
     } else {
       xaw_set_label(help_improvement_req_data,
-                   advances[imp->tech_req].name);
+                   advance_name_translation(imp->tech_req));
     }*/
 
      /* FIXME: this should show ranges and all the MAX_NUM_REQS reqs. 
@@ -805,7 +805,7 @@
 
     if (tech_exists(imp->obsolete_by)) {
       xaw_set_label(help_wonder_obsolete_data,
-                   advances[imp->obsolete_by].name);
+                   advance_name_translation(imp->obsolete_by));
     } else {
       xaw_set_label(help_wonder_obsolete_data, _("(Never)"));
     }
@@ -931,14 +931,16 @@
       if(i==advances[j].req[0]) {
        if(advances[j].req[1]==A_NONE)
          sprintf(buf+strlen(buf), _("Allows %s.\n"), 
-                 advances[j].name);
+                 advance_name_translation(j));
        else
          sprintf(buf+strlen(buf), _("Allows %s (with %s).\n"), 
-                 advances[j].name, advances[advances[j].req[1]].name);
+                 advance_name_translation(j),
+                 advance_name_translation(advances[j].req[1]));
       }
       if(i==advances[j].req[1]) {
        sprintf(buf+strlen(buf), _("Allows %s (with %s).\n"), 
-               advances[j].name, advances[advances[j].req[0]].name);
+               advance_name_translation(j),
+               advance_name_translation(advances[j].req[0]));
       }
     }
     if (strlen(buf)) strcat(buf, "\n");
Index: client/gui-win32/repodlgs.c
===================================================================
--- client/gui-win32/repodlgs.c (revision 13039)
+++ client/gui-win32/repodlgs.c (working copy)
@@ -214,7 +214,7 @@
                                        to);
              
              if (IsDlgButtonChecked(hWnd, ID_SCIENCE_HELP)) {
-               popup_help_dialog_typed(advances[to].name, HELP_TECH);
+               popup_help_dialog_typed(advance_name_translation(to), 
HELP_TECH);
                science_dialog_update();
              } else {
                dsend_packet_player_research(&aconnection, to);
Index: client/gui-win32/dialogs.c
===================================================================
--- client/gui-win32/dialogs.c  (revision 13039)
+++ client/gui-win32/dialogs.c  (working copy)
@@ -1189,7 +1189,7 @@
       if(get_invention(pvictim, i)==TECH_KNOWN && 
          (get_invention(pplayer, i)==TECH_UNKNOWN || 
           get_invention(pplayer, i)==TECH_REACHABLE)) {
-       ListBox_AddString(lb,advances[i].name);
+       ListBox_AddString(lb,advance_name_translation(i));
         advance_type[j++] = i;
       }
     }
Index: client/gui-win32/diplodlg.c
===================================================================
--- client/gui-win32/diplodlg.c (revision 13039)
+++ client/gui-win32/diplodlg.c (working copy)
@@ -177,7 +177,7 @@
         && (get_invention(plr1, i) == TECH_UNKNOWN  
             || get_invention(plr1, i) == TECH_REACHABLE)
         && tech_is_available(plr1, i)) {
-      AppendMenu(menu,MF_STRING,ID_ADVANCES_BASE+i,advances[i].name);
+      
AppendMenu(menu,MF_STRING,ID_ADVANCES_BASE+i,advance_name_translation(i));
       iteminfo.dwItemData = plr0->player_no * MAX_NUM_ITEMS * MAX_NUM_ITEMS +
                            plr1->player_no * MAX_NUM_ITEMS + i;
       iteminfo.fMask = MIIM_DATA;
Index: client/gui-win32/inteldlg.c
===================================================================
--- client/gui-win32/inteldlg.c (revision 13039)
+++ client/gui-win32/inteldlg.c (working copy)
@@ -143,10 +143,10 @@
   for(i=A_FIRST, j=0; i<game.control.num_tech_types; i++)
     if(get_invention(p, i)==TECH_KNOWN) {
       if(get_invention(game.player_ptr, i)==TECH_KNOWN) {
-        sz_strlcpy(tech_list_names[j], advances[i].name);
+        sz_strlcpy(tech_list_names[j], advance_name_translation(i));
       } else {
         my_snprintf(tech_list_names[j], sizeof(tech_list_names[j]),
-                    "%s*", advances[i].name);
+                    "%s*", advance_name_translation(i));
       }
       ListBox_AddString(lb,tech_list_names[j]);
       j++;
Index: client/gui-win32/helpdlg.c
===================================================================
--- client/gui-win32/helpdlg.c  (revision 13039)
+++ client/gui-win32/helpdlg.c  (working copy)
@@ -163,7 +163,7 @@
            char s[128];
            GetWindowText((HWND)lParam,s,sizeof(s));
            if (strcmp(s, _("(Never)")) != 0 && strcmp(s, _("None")) != 0
-               && strcmp(s, advances[A_NONE].name) != 0)
+               && strcmp(s, advance_name_translation(A_NONE)) != 0)
              select_help_item_string(s,page_type_from_id(LOWORD(wParam)));
            
          }
@@ -708,7 +708,7 @@
     if(utype->tech_requirement==A_LAST) {
       SetWindowText(help_ulabel[4][1], _("(Never)"));
     } else {
-      SetWindowText(help_ulabel[4][1], advances[utype->tech_requirement].name);
+      SetWindowText(help_ulabel[4][1], 
advance_name_translation(utype->tech_requirement));
     }
     /*    create_tech_tree(help_improvement_tree, 0, utype->tech_requirement, 
3);*/
     if (utype->obsoleted_by == U_NOT_OBSOLETED) {
@@ -801,16 +801,16 @@
          hbox=fcwin_hbox_new(helpdlg_win,FALSE);
          fcwin_box_add_box(helpdlg_page_vbox,hbox,FALSE,FALSE,5);
          fcwin_box_add_static(hbox,_("Allows "),0,SS_LEFT,FALSE,FALSE,5);
-         fcwin_box_add_button(hbox,advances[j].name,
+         fcwin_box_add_button(hbox,advance_name_translation(j),
                               ID_HELP_TECH_LINK,0,FALSE,FALSE,5);
        } else {
          hbox=fcwin_hbox_new(helpdlg_win,FALSE);
          fcwin_box_add_box(helpdlg_page_vbox,hbox,FALSE,FALSE,5);
          fcwin_box_add_static(hbox,_("Allows "),0,SS_LEFT,FALSE,FALSE,5);
-         fcwin_box_add_button(hbox,advances[j].name,
+         fcwin_box_add_button(hbox,advance_name_translation(j),
                               ID_HELP_TECH_LINK,0,FALSE,FALSE,5);
          fcwin_box_add_static(hbox,_(" (with "),0,SS_LEFT,FALSE,FALSE,5);
-         fcwin_box_add_button(hbox,advances[advances[j].req[1]].name,
+         
fcwin_box_add_button(hbox,advance_name_translation(advances[j].req[1]),
                               ID_HELP_TECH_LINK,0,FALSE,FALSE,5);
          fcwin_box_add_static(hbox,Q_("?techhelp:)."),
                               0,SS_LEFT,FALSE,FALSE,5);
@@ -820,10 +820,10 @@
        hbox=fcwin_hbox_new(helpdlg_win,FALSE);
        fcwin_box_add_box(helpdlg_page_vbox,hbox,FALSE,FALSE,5);
        fcwin_box_add_static(hbox,_("Allows "),0,SS_LEFT,FALSE,FALSE,5);
-       fcwin_box_add_button(hbox,advances[j].name,
+       fcwin_box_add_button(hbox,advance_name_translation(j),
                             ID_HELP_TECH_LINK,0,FALSE,FALSE,5);
        fcwin_box_add_static(hbox,_(" (with "),0,SS_LEFT,FALSE,FALSE,5);
-       fcwin_box_add_button(hbox,advances[advances[j].req[0]].name,
+       fcwin_box_add_button(hbox,advance_name_translation(advances[j].req[0]),
                             ID_HELP_TECH_LINK,0,FALSE,FALSE,5);
        fcwin_box_add_static(hbox,Q_("?techhelp:)."),
                             0,SS_LEFT,FALSE,FALSE,5);
Index: client/gui-sdl/repodlgs.c
===================================================================
--- client/gui-sdl/repodlgs.c   (revision 13039)
+++ client/gui-sdl/repodlgs.c   (working copy)
@@ -2885,7 +2885,7 @@
     
     count++;  
     
-    copy_chars_to_string16(pStr, advances[i].name);
+    copy_chars_to_string16(pStr, advance_name_translation(i));
     pSurf = create_sellect_tech_icon(pStr, i, MED_MODE);
     pBuf = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);
@@ -3076,7 +3076,7 @@
            || i == get_player_research(game.player_ptr)->tech_goal)) {
     
       count++;
-      my_snprintf(cBuf, sizeof(cBuf), "%s\n%d %s", advances[i].name, num,
+      my_snprintf(cBuf, sizeof(cBuf), "%s\n%d %s", 
advance_name_translation(i), num,
                                                PL_("step", "steps", num));
       copy_chars_to_string16(pStr, cBuf);
       pSurf = create_sellect_tech_icon(pStr, i, FULL_MODE);
Index: client/gui-sdl/diplomat_dialog.c
===================================================================
--- client/gui-sdl/diplomat_dialog.c    (revision 13039)
+++ client/gui-sdl/diplomat_dialog.c    (working copy)
@@ -310,7 +310,7 @@
       || get_invention(game.player_ptr, i)==TECH_REACHABLE)) {
     
       count++;  
-      copy_chars_to_string16(pStr, advances[i].name);
+      copy_chars_to_string16(pStr, advance_name_translation(i));
       pSurf = create_sellect_tech_icon(pStr, i, FULL_MODE);
       pBuf = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);
Index: client/gui-sdl/diplodlg.c
===================================================================
--- client/gui-sdl/diplodlg.c   (revision 13039)
+++ client/gui-sdl/diplodlg.c   (working copy)
@@ -611,7 +611,7 @@
              add_to_gui_list(ID_LABEL, pBuf);
             count++;
             
-            my_snprintf(cBuf, sizeof(cBuf), "  %s", advances[i].name);
+            my_snprintf(cBuf, sizeof(cBuf), "  %s", 
advance_name_translation(i));
   
              pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, cBuf, 
adj_font(12),
                 (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE));
@@ -636,7 +636,7 @@
          (get_invention(pPlayer1, i) == TECH_UNKNOWN || 
           get_invention(pPlayer1, i) == TECH_REACHABLE)) {
             
-            my_snprintf(cBuf, sizeof(cBuf), "  %s", advances[i].name);
+            my_snprintf(cBuf, sizeof(cBuf), "  %s", 
advance_name_translation(i));
   
              pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, cBuf, 
adj_font(12),
                 (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE));
Index: client/gui-sdl/inteldlg.c
===================================================================
--- client/gui-sdl/inteldlg.c   (revision 13039)
+++ client/gui-sdl/inteldlg.c   (working copy)
@@ -321,7 +321,7 @@
         pBuf->action = tech_callback;
         set_wstate(pBuf, FC_WS_NORMAL);
   
-        pBuf->string16 = create_str16_from_char(advances[i].name, 
adj_font(12));
+        pBuf->string16 = create_str16_from_char(advance_name_translation(i), 
adj_font(12));
           
         add_to_gui_list(ID_ICON, pBuf);
           
Index: client/gui-sdl/helpdlg.c
===================================================================
--- client/gui-sdl/helpdlg.c    (revision 13039)
+++ client/gui-sdl/helpdlg.c    (working copy)
@@ -385,7 +385,8 @@
     pBuf->ID = ID_LABEL;
   } else {
     pBuf = create_iconlabel_from_chars(NULL, pWindow->dst,
-             advances[pImpr_type->obsolete_by].name, adj_font(12),
+             advance_name_translation(pImpr_type->obsolete_by),
+             adj_font(12),
                          WF_RESTORE_BACKGROUND);
     pBuf->ID = MAX_ID - pImpr_type->obsolete_by;
     pBuf->string16->fgcol = *get_tech_color(pImpr_type->obsolete_by);
@@ -762,7 +763,8 @@
     pBuf->ID = ID_LABEL;
   } else {
     pBuf = create_iconlabel_from_chars(NULL, pWindow->dst,
-         advances[pUnitType->tech_requirement].name, adj_font(12),
+         advance_name_translation(pUnitType->tech_requirement),
+         adj_font(12),
                          WF_RESTORE_BACKGROUND);
     pBuf->ID = MAX_ID - pUnitType->tech_requirement;
     pBuf->string16->fgcol = *get_tech_color(pUnitType->tech_requirement);
@@ -1012,7 +1014,10 @@
   
   /* tech name (heading) */
   pBuf= create_iconlabel_from_chars(get_tech_icon(tech),
-                   pWindow->dst, advances[tech].name, adj_font(24), 
WF_FREE_THEME);
+                   pWindow->dst,
+                   advance_name_translation(tech),
+                   adj_font(24),
+                   WF_FREE_THEME);
 
   pBuf->ID = ID_LABEL;
   DownAdd(pBuf, pDock);
@@ -1025,7 +1030,7 @@
     if ((targets_count < 6) &&
         (advances[i].req[0] == tech || advances[i].req[1] == tech))
     {
-      pBuf= create_iconlabel_from_chars(NULL, pWindow->dst, advances[i].name,
+      pBuf= create_iconlabel_from_chars(NULL, pWindow->dst, 
advance_name_translation(i),
                                     adj_font(12), WF_RESTORE_BACKGROUND);
       pBuf->string16->fgcol = *get_tech_color(i);
       max_width = MAX(max_width, pBuf->size.w);
@@ -1062,7 +1067,9 @@
        }
       }
       pBuf= create_iconlabel_from_chars(NULL, pWindow->dst,
-           advances[sub_tech].name, adj_font(12), WF_RESTORE_BACKGROUND);
+           advance_name_translation(sub_tech),
+           adj_font(12),
+           WF_RESTORE_BACKGROUND);
       pBuf->string16->fgcol = *get_tech_color(sub_tech);
       set_wstate(pBuf, FC_WS_NORMAL);
       pBuf->action = change_tech_callback;
@@ -1572,7 +1579,7 @@
   pStr = create_string16(NULL, 0, adj_font(10));
   pStr->style |= (TTF_STYLE_BOLD | SF_CENTER);
 
-  copy_chars_to_string16(pStr, advances[tech].name);
+  copy_chars_to_string16(pStr, advance_name_translation(tech));
   pSurf = create_sellect_tech_icon(pStr, tech, FULL_MODE);
   pBuf = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);
@@ -1589,7 +1596,7 @@
   {
     if (tech_exists(i) && advances[tech].req[i] != A_NONE)
     {
-      copy_chars_to_string16(pStr, advances[advances[tech].req[i]].name);
+      copy_chars_to_string16(pStr, 
advance_name_translation(advances[tech].req[i]));
       pSurf = create_sellect_tech_icon(pStr, advances[tech].req[i], 
SMALL_MODE);
       pBuf = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);
@@ -1617,7 +1624,7 @@
       {
         if (tech_exists(i) && advances[sub_tech].req[i] != A_NONE)
         {
-          copy_chars_to_string16(pStr, 
advances[advances[sub_tech].req[i]].name);
+          copy_chars_to_string16(pStr, 
advance_name_translation(advances[sub_tech].req[i]));
           pSurf = create_sellect_tech_icon(pStr, advances[sub_tech].req[i], 
SMALL_MODE);
           pBuf = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);
@@ -1643,7 +1650,7 @@
     if ((targets_count<6)
       && (advances[i].req[0] == tech || advances[i].req[1] == tech))
     {
-      copy_chars_to_string16(pStr, advances[i].name);
+      copy_chars_to_string16(pStr, advance_name_translation(i));
       pSurf = create_sellect_tech_icon(pStr, i, SMALL_MODE);
       pBuf = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);
@@ -1682,7 +1689,7 @@
        }
       }
       
-      copy_chars_to_string16(pStr, advances[sub_tech].name);
+      copy_chars_to_string16(pStr, advance_name_translation(sub_tech));
       pSurf = create_sellect_tech_icon(pStr, sub_tech, SMALL_MODE);
       pBuf = create_icon2(pSurf, pWindow->dst,
        WF_FREE_THEME | WF_RESTORE_BACKGROUND);
@@ -1889,7 +1896,7 @@
     {
       if (tech_exists(i))
       {
-        copy_chars_to_string16(pStr, advances[i].name);
+        copy_chars_to_string16(pStr, advance_name_translation(i));
         pSurf = create_sellect_tech_icon(pStr, i, SMALL_MODE);
         pBuf = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);
Index: client/gui-mui/repodlgs.c
===================================================================
--- client/gui-mui/repodlgs.c   (revision 13039)
+++ client/gui-mui/repodlgs.c   (working copy)
@@ -107,11 +107,11 @@
   int to = -1;
 
   if (game.player_ptr->research->tech_goal == A_UNSET)
-    if (help_goal_entries[*newgoal] == (STRPTR) advances[A_NONE].name)
+    if (help_goal_entries[*newgoal] == (STRPTR) 
advance_name_translation(A_NONE))
       to = 0;
   for (i = A_FIRST; i < game.control.num_tech_types; i++)
   {
-    if (help_goal_entries[*newgoal] == (STRPTR) advances[i].name)
+    if (help_goal_entries[*newgoal] == (STRPTR) advance_name_translation(i))
       to = i;
   }
 
@@ -120,7 +120,7 @@
     if (xget(science_help_button, MUIA_Selected))
     {
       nnset(science_goal_popup, MUIA_Cycle_Active, science_goal_active);
-      popup_help_dialog_typed(advances[to].name, HELP_TECH);
+      popup_help_dialog_typed(advance_name_translation(to), HELP_TECH);
     }
     else
     {
@@ -142,7 +142,7 @@
 
   for (i = A_FIRST; i < game.control.num_tech_types; i++)
   {
-    if (help_research_entries[*newresearch] == (STRPTR) advances[i].name)
+    if (help_research_entries[*newresearch] == (STRPTR) 
advance_name_translation(i))
       to = i;
   }
 
@@ -151,7 +151,7 @@
     if (xget(science_help_button, MUIA_Selected))
     {
       nnset(science_goal_popup, MUIA_Cycle_Active, science_goal_active);
-      popup_help_dialog_typed(advances[to].name, HELP_TECH);
+      popup_help_dialog_typed(advance_name_translation(to), HELP_TECH);
     }
     else
     {
@@ -165,7 +165,7 @@
 ****************************************************************/
 static void science_researched(ULONG * tech)
 {
-  popup_help_dialog_typed(advances[*tech].name, HELP_TECH);
+  popup_help_dialog_typed(advance_name_translation(*tech), HELP_TECH);
 }
 
 /****************************************************************
@@ -211,7 +211,7 @@
          if (i == game.player_ptr->research.researching)
            science_research_active = j;
 
-         help_research_entries[j++] = advances[i].name;
+         help_research_entries[j++] = advance_name_translation(i);
        }
        help_research_entries[j] = NULL;
        research_entries = help_research_entries;
@@ -238,7 +238,7 @@
     {
       j = 0;
       if (game.player_ptr->research->tech_goal == A_UNSET) {
-       help_goal_entries[j++] = advances[A_NONE].name;
+       help_goal_entries[j++] = advance_name_translation(A_NONE);
       }
 
       for (i = A_FIRST; i < game.control.num_tech_types; i++)
@@ -249,7 +249,7 @@
        {
          if (i == game.player_ptr->research->tech_goal)
            science_goal_active = j;
-         help_goal_entries[j++] = advances[i].name;
+         help_goal_entries[j++] = advance_name_translation(i);
        }
       }
 
@@ -364,7 +364,8 @@
       if ((get_invention(game.player_ptr, i) == TECH_KNOWN))
       {
        Object *tech = TextObject,
-           MUIA_Text_Contents, advances[i].name,
+           MUIA_Text_Contents,
+           advance_name_translation(i),
            MUIA_InputMode, MUIV_InputMode_RelVerify,
            MUIA_CycleChain, 1,
            End;
Index: client/gui-mui/dialogs.c
===================================================================
--- client/gui-mui/dialogs.c    (revision 13039)
+++ client/gui-mui/dialogs.c    (working copy)
@@ -296,7 +296,7 @@
   {
     int tech = which-100;
     if (tech == game.control.num_tech_types) *array = _("At Spy's Discretion");
-    else *array = advances[which-100].name;
+    else *array = advance_name_translation(which-100);
   }
   else
     *array = _("Technology");
Index: client/gui-mui/diplodlg.c
===================================================================
--- client/gui-mui/diplodlg.c   (revision 13039)
+++ client/gui-mui/diplodlg.c   (working copy)
@@ -261,7 +261,7 @@
             || get_invention(plr1, i) == TECH_REACHABLE)
         && tech_is_available(plr1, i))
     {
-      entry = MUI_MakeObject(MUIO_Menuitem,advances[i].name,NULL,0,0);
+      entry = 
MUI_MakeObject(MUIO_Menuitem,advance_name_translation(i),NULL,0,0);
       set(entry,MUIA_UserData,i);
       DoMethod(entry,MUIM_Notify,MUIA_Menuitem_Trigger, MUIV_EveryTime, 
entry,6, MUIM_CallHook, &civstandard_hook, diplomacy_tech, pdialog, 
plr0->player_no,entry);
       DoMethod(menu_title,MUIM_Family_AddTail, entry);
Index: client/gui-mui/inteldlg.c
===================================================================
--- client/gui-mui/inteldlg.c   (revision 13039)
+++ client/gui-mui/inteldlg.c   (working copy)
@@ -85,7 +85,7 @@
 *****************************************************************/
 static void intel_tech( ULONG *tech)
 {
-  popup_help_dialog_typed( advances[*tech].name, HELP_TECH);
+  popup_help_dialog_typed( advance_name_translation(*tech), HELP_TECH);
 }
 
 /****************************************************************
@@ -156,7 +156,8 @@
       if (get_invention(p, i) == TECH_KNOWN)
       {
        Object *tech = ColorTextObject,
-           MUIA_ColorText_Contents, advances[i].name,
+           MUIA_ColorText_Contents,
+           advance_name_translation(i),
            MUIA_ColorText_Background, GetTechBG(i),
            MUIA_InputMode, MUIV_InputMode_RelVerify,
            End;
Index: client/gui-mui/helpdlg.c
===================================================================
--- client/gui-mui/helpdlg.c    (revision 13039)
+++ client/gui-mui/helpdlg.c    (working copy)
@@ -157,7 +157,7 @@
   enum help_page_type type = (enum help_page_type) xget(*text_obj, 
MUIA_UserData);
 
   if (strcmp(s, _("(Never)")) != 0 && strcmp(s, _("None")) != 0
-      && strcmp(s, advances[A_NONE].name) != 0)
+      && strcmp(s, advance_name_translation(A_NONE)) != 0)
   {
     int idx;
 
@@ -227,7 +227,7 @@
   else if(tech == TECHTYPE_NONE)
     text = _("None");
   else
-    text = advances[tech].name;
+    text = advance_name_translation(tech);
 
   return text;
 }
@@ -396,7 +396,8 @@
     return;
   }
   
-  my_snprintf(label, sizeof(label), "%s:%d", advances[tech].name,
+  my_snprintf(label, sizeof(label), "%s:%d",
+             advance_name_translation(tech),
              num_unknown_techs_for_goal(game.player_ptr, tech));
 
   o = ColorTextObject,
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to