tEnsure that the display of drug and gun names in the deal drugs and inventory dialogs is tstring-aware. - vaccinewars - be a doctor and try to vaccinate the world
git clone git://src.adamsgaard.dk/vaccinewars
Log
Files
Refs
README
LICENSE
---
commit 826d066c24e59c2fb7708bfc648073a18b18228e
parent 3e60e24dc29126ab682a7f00b2f207acfcf38a38
Author: Ben Webb 
Date:   Mon,  9 Jun 2003 10:25:36 +0000

Ensure that the display of drug and gun names in the deal drugs and
inventory dialogs is tstring-aware.


Diffstat:
  M src/gui_client/gtk_client.c         |      10 +++++++---

1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/gui_client/gtk_client.c b/src/gui_client/gtk_client.c
t@@ -1339,10 +1339,12 @@ void UpdateInventory(struct InventoryWidgets *Inven,
 
   for (i = 0; i < NumObjects; i++) {
     if (AreDrugs) {
-      titles[0] = Drug[i].Name;
+      titles[0] = dpg_strdup_printf(_("%/Inventory drug name/%tde"),
+                                    Drug[i].Name);
       price = Objects[i].Price;
     } else {
-      titles[0] = Gun[i].Name;
+      titles[0] = dpg_strdup_printf(_("%/Inventory gun name/%tde"),
+                                    Gun[i].Name);
       price = Gun[i].Price;
     }
 
t@@ -1379,6 +1381,7 @@ void UpdateInventory(struct InventoryWidgets *Inven,
         gtk_clist_select_row(GTK_CLIST(carrylist), row, 0);
       }
     }
+    g_free(titles[0]);
   }
 
   for (i = 0; i < numlist; i++) {
t@@ -1684,7 +1687,8 @@ void DealDrugs(GtkWidget *widget, gpointer data)
         || (data == BT_SELL && Play->Drugs[i].Carried > 0
          && Play->Drugs[i].Price != 0)
         || (data == BT_BUY && Play->Drugs[i].Price != 0)) {
-      menuitem = gtk_menu_item_new_with_label(Drug[i].Name);
+      dpg_string_sprintf(text, _("%/DealDrugs drug name/%tde"), Drug[i].Name);
+      menuitem = gtk_menu_item_new_with_label(text->str);
       gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
                          GTK_SIGNAL_FUNC(DealSelectCallback),
                          GINT_TO_POINTER(i));