Author: cazfi
Date: Fri May 13 16:30:30 2016
New Revision: 32688

URL: http://svn.gna.org/viewcvs/freeciv?rev=32688&view=rev
Log:
Show "TRUE" and "FALSE" in their translated form when listing values of boolean
properties in the editor.

See bug #24660

Modified:
    branches/S2_5/client/gui-gtk-2.0/editprop.c
    branches/S2_5/client/gui-gtk-3.0/editprop.c

Modified: branches/S2_5/client/gui-gtk-2.0/editprop.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-gtk-2.0/editprop.c?rev=32688&r1=32687&r2=32688&view=diff
==============================================================================
--- branches/S2_5/client/gui-gtk-2.0/editprop.c (original)
+++ branches/S2_5/client/gui-gtk-2.0/editprop.c Fri May 13 16:30:30 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 2005 - The Freeciv Project
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -2557,7 +2557,8 @@
   case VALTYPE_INT:
     return G_TYPE_INT;
   case VALTYPE_BOOL:
-    return G_TYPE_BOOLEAN;
+    /* We want to show it as translated string, not as untranslated 
G_TYPE_BOOLEAN */
+    return G_TYPE_STRING;
   case VALTYPE_STRING:
   case VALTYPE_BUILT_ARRAY:
   case VALTYPE_INVENTIONS_ARRAY:
@@ -4147,7 +4148,7 @@
   struct objprop *MY_op = objprop_new(ARG_id, ARG_name,\
                                       ARG_flags, ARG_valtype, pp);\
   objprop_hash_insert(pp->objprop_table, MY_op->id, MY_op);\
-} while (0)
+} while (FALSE)
 
   switch (property_page_get_objtype(pp)) {
   case OBJTYPE_TILE:
@@ -5003,7 +5004,8 @@
     gtk_list_store_set(store, iter, col_id, pv->data.v_int, -1);
     break;
   case VALTYPE_BOOL:
-    gtk_list_store_set(store, iter, col_id, pv->data.v_bool, -1);
+    /* Set as translated string, not as untranslated G_TYPE_BOOLEAN */
+    gtk_list_store_set(store, iter, col_id, propval_as_string(pv), -1);
     break;
   case VALTYPE_STRING:
     if (fc_strlcpy(buf, pv->data.v_string, 28) >= 28) {

Modified: branches/S2_5/client/gui-gtk-3.0/editprop.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-gtk-3.0/editprop.c?rev=32688&r1=32687&r2=32688&view=diff
==============================================================================
--- branches/S2_5/client/gui-gtk-3.0/editprop.c (original)
+++ branches/S2_5/client/gui-gtk-3.0/editprop.c Fri May 13 16:30:30 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 2005 - The Freeciv Project
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -2557,7 +2557,8 @@
   case VALTYPE_INT:
     return G_TYPE_INT;
   case VALTYPE_BOOL:
-    return G_TYPE_BOOLEAN;
+    /* We want to show it as translated string, not as untranslated 
G_TYPE_BOOLEAN */
+    return G_TYPE_STRING;
   case VALTYPE_STRING:
   case VALTYPE_BUILT_ARRAY:
   case VALTYPE_INVENTIONS_ARRAY:
@@ -4178,7 +4179,7 @@
   struct objprop *MY_op = objprop_new(ARG_id, ARG_name,\
                                       ARG_flags, ARG_valtype, pp);\
   objprop_hash_insert(pp->objprop_table, MY_op->id, MY_op);\
-} while (0)
+} while (FALSE)
 
   switch (property_page_get_objtype(pp)) {
   case OBJTYPE_TILE:
@@ -5050,7 +5051,8 @@
     gtk_list_store_set(store, iter, col_id, pv->data.v_int, -1);
     break;
   case VALTYPE_BOOL:
-    gtk_list_store_set(store, iter, col_id, pv->data.v_bool, -1);
+    /* Set as translated string, not as untranslated G_TYPE_BOOLEAN */
+    gtk_list_store_set(store, iter, col_id, propval_as_string(pv), -1);
     break;
   case VALTYPE_STRING:
     if (fc_strlcpy(buf, pv->data.v_string, 28) >= 28) {


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

Reply via email to