When translation potentially empty strings, check always for nonemptyness. Should avoid #330179 in the rest of the code as well.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13206 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2006-02-11 11:14:43 +00:00
parent 136cc78b4d
commit 1f61299d0d
5 changed files with 9 additions and 16 deletions

View File

@ -32,6 +32,6 @@
char *
gnc_gettext_helper(const char *string)
{
return strdup(_(string));
return strdup(string && *string ? _(string) : "");
}

View File

@ -572,7 +572,7 @@ gnc_find_or_create_equity_account (AccountGroup *group,
if (!account)
{
base_name = _(base_name);
base_name = base_name && *base_name ? _(base_name) : "";
account = xaccGetAccountFromName (group, base_name);
if (account && xaccAccountGetType (account) != EQUITY)

View File

@ -559,19 +559,12 @@ gnc_option_create_multichoice_widget(GNCOption *option, GtkTooltips *tooltips)
}
/* 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);

View File

@ -383,7 +383,7 @@ gnc_recn_make_interest_window_name(Account *account, char *text)
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);

View File

@ -167,7 +167,7 @@ gnc_report_window_default_params_editor(SCM options, SCM report)
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);