Skip to content

Commit

Permalink
Summary bar currencies not displayed correctly for Hebrew
Browse files Browse the repository at this point in the history
When Gnucash is run in Hebrew which is a RTL language, on the accounts
page the summary bar currencies are not displayed correctly...

To fix this, when creating the displayed monetary amount insert a BiDi
ltr isolate uni-character at the start of the string.
  • Loading branch information
Bob-IT committed Mar 14, 2022
1 parent f8fc796 commit c84d82e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions gnucash/gnome-utils/window-main-summarybar.c
Expand Up @@ -399,6 +399,7 @@ gnc_main_window_summary_refresh (GNCMainSummary * summary)
for (current = g_list_first(currency_list); current; current = g_list_next(current))
{
gchar *total_mode_label;
gchar *bidi_total, *bidi_asset_amount, *bidi_profit_amount;

currency_accum = current->data;

Expand All @@ -412,16 +413,22 @@ gnc_main_window_summary_refresh (GNCMainSummary * summary)

gtk_list_store_append(summary->datamodel, &iter);
total_mode_label = get_total_mode_label (currency_accum);
bidi_total = gnc_wrap_text_with_bidi_ltr_isolate(total_mode_label);
bidi_asset_amount = gnc_wrap_text_with_bidi_ltr_isolate(asset_amount_string);
bidi_profit_amount = gnc_wrap_text_with_bidi_ltr_isolate(profit_amount_string);
gtk_list_store_set(summary->datamodel, &iter,
COLUMN_MNEMONIC_TYPE, total_mode_label,
COLUMN_MNEMONIC_TYPE, bidi_total,
COLUMN_ASSETS, _("Net Assets:"),
COLUMN_ASSETS_VALUE, asset_amount_string,
COLUMN_ASSETS_VALUE, bidi_asset_amount,
COLUMN_ASSETS_NEG, gnc_numeric_negative_p(currency_accum->assets),
COLUMN_PROFITS, _("Profits:"),
COLUMN_PROFITS_VALUE, profit_amount_string,
COLUMN_PROFITS_VALUE, bidi_profit_amount,
COLUMN_PROFITS_NEG, gnc_numeric_negative_p(currency_accum->profits),
-1);
g_free(total_mode_label);
g_free(bidi_total);
g_free(bidi_asset_amount);
g_free(bidi_profit_amount);
}
gtk_combo_box_set_model(GTK_COMBO_BOX(summary->totals_combo),
GTK_TREE_MODEL(summary->datamodel));
Expand Down

0 comments on commit c84d82e

Please sign in to comment.