[Gnucash-changes] r13206 - gnucash/trunk/src - When translation potentially empty strings, check always for nonemptyness. Should avoid #330179 in the rest of the code as well.

Christian Stimming cstim at cvs.gnucash.org
Sat Feb 11 06:14:44 EST 2006


Author: cstim
Date: 2006-02-11 06:14:43 -0500 (Sat, 11 Feb 2006)
New Revision: 13206
Trac: http://svn.gnucash.org/trac/changeset/13206

Modified:
   gnucash/trunk/src/app-utils/gnc-gettext-util.c
   gnucash/trunk/src/app-utils/gnc-ui-util.c
   gnucash/trunk/src/gnome-utils/dialog-options.c
   gnucash/trunk/src/gnome/window-reconcile.c
   gnucash/trunk/src/report/report-gnome/window-report.c
Log:
When translation potentially empty strings, check always for nonemptyness. Should avoid #330179 in the rest of the code as well.

Modified: gnucash/trunk/src/app-utils/gnc-gettext-util.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-gettext-util.c	2006-02-11 10:55:34 UTC (rev 13205)
+++ gnucash/trunk/src/app-utils/gnc-gettext-util.c	2006-02-11 11:14:43 UTC (rev 13206)
@@ -32,6 +32,6 @@
 char *
 gnc_gettext_helper(const char *string)
 {
-  return strdup(_(string));
+  return strdup(string && *string ? _(string) : "");
 }
 

Modified: gnucash/trunk/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.c	2006-02-11 10:55:34 UTC (rev 13205)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.c	2006-02-11 11:14:43 UTC (rev 13206)
@@ -572,7 +572,7 @@
 
   if (!account)
   {
-    base_name = _(base_name);
+    base_name = base_name && *base_name ? _(base_name) : "";
 
     account = xaccGetAccountFromName (group, base_name);
     if (account && xaccAccountGetType (account) != EQUITY)

Modified: gnucash/trunk/src/gnome/window-reconcile.c
===================================================================
--- gnucash/trunk/src/gnome/window-reconcile.c	2006-02-11 10:55:34 UTC (rev 13205)
+++ gnucash/trunk/src/gnome/window-reconcile.c	2006-02-11 11:14:43 UTC (rev 13206)
@@ -383,7 +383,7 @@
   char *title;
 
   fullname = xaccAccountGetFullName(account, gnc_get_account_separator());
-  title = g_strconcat(fullname, " - ", _(text), NULL);
+  title = g_strconcat(fullname, " - ", text && *text ? _(text) : "", NULL);
 
   g_free(fullname);
 

Modified: gnucash/trunk/src/gnome-utils/dialog-options.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-options.c	2006-02-11 10:55:34 UTC (rev 13205)
+++ gnucash/trunk/src/gnome-utils/dialog-options.c	2006-02-11 11:14:43 UTC (rev 13206)
@@ -559,19 +559,12 @@
     }
 
     /* FIXME: tooltip texts for each option are available but cannot
-       be set currently. See
-       https://lists.gnucash.org/pipermail/gnucash-devel/2005-December/015139.html 
+       be set currently. See http://wiki.gnucash.org/wiki/Tooltips.
+       The current idea is to revert the widget back to the
+       GtkOptionMenu code from 1.8-branch until
+       http://bugzilla.gnome.org/show_bug.cgi?id=303717 is implemented
+       in gtk.
     */
-    /* Old 1-8-branch code:
-    string = gnc_option_permissible_value_description(option, i);
-    gnc_gtk_combo_box_set_tooltip(GTK_COMBO_BOX(widget),
-    	string && *string ? _(string) : "");
-    if (string)
-      g_free(string);
-    */
-    /* New code needs to do something like this:
-       gtk_tooltips_set_tip(tooltips, widget, string ? _(string) : "", NULL);
-     */
   }
   g_signal_connect(G_OBJECT(widget), "changed",
         	   G_CALLBACK(gnc_option_multichoice_cb), option);

Modified: gnucash/trunk/src/report/report-gnome/window-report.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/window-report.c	2006-02-11 10:55:34 UTC (rev 13205)
+++ gnucash/trunk/src/report/report-gnome/window-report.c	2006-02-11 11:14:43 UTC (rev 13206)
@@ -167,7 +167,7 @@
       title = SCM_STRING_CHARS(ptr);
     }
     /* Don't forget to translate the window title */
-    prm->win  = gnc_options_dialog_new((gchar*)_(title));
+    prm->win  = gnc_options_dialog_new((gchar*) (title && *title ? _(title) : ""));
     
     scm_gc_protect_object(prm->scm_options);
     scm_gc_protect_object(prm->cur_report);



More information about the gnucash-changes mailing list