From 464a2e805d6dde32c67f9622b338f2af503bcf6a Mon Sep 17 00:00:00 2001 From: "Huang, Zhaoquan" Date: Tue, 29 Oct 2024 10:20:20 +0800 Subject: [PATCH] =?UTF-8?q?Bug=20799451=20-=20Cannot=20translate=20differe?= =?UTF-8?q?nt=20meanings=20of=20string=E2=80=A6=20=20"=5FBalance"=20to=20C?= =?UTF-8?q?hinese.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix for this ticket added context for some uses of string "Balance" but that's not part of the original ticket and doesn't have ambiguity (it's always used as a noun). The real problem "_Balance" (the underscore indicates it is a label of an action) however is not fully covered. This ticket adds context all uses of "_Balance" and removed the unnecesary contexts for "Balance". --- gnucash/gnome-utils/gnc-tree-view-account.c | 4 ++-- gnucash/gnome-utils/gnc-tree-view-owner.c | 20 +++++++++----------- gnucash/gnome/dialog-lot-viewer.c | 4 ++-- gnucash/gtkbuilder/dialog-account.glade | 2 +- gnucash/ui/gnc-reconcile-window.ui | 4 ++-- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c index b9c7b83cdda..cdbc3a8ca23 100644 --- a/gnucash/gnome-utils/gnc-tree-view-account.c +++ b/gnucash/gnome-utils/gnc-tree-view-account.c @@ -834,7 +834,7 @@ gnc_tree_view_account_new_with_root (Account *root, gboolean show_root) GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, sort_by_present_value); - gnc_tree_view_add_numeric_column(GNC_TREE_VIEW(view), C_("column header", "Balance"), "balance", + gnc_tree_view_add_numeric_column(GNC_TREE_VIEW(view), _("Balance"), "balance", SAMPLE_ACCOUNT_VALUE, GNC_TREE_MODEL_ACCOUNT_COL_BALANCE, GNC_TREE_MODEL_ACCOUNT_COL_COLOR_BALANCE, @@ -1787,7 +1787,7 @@ gtva_update_column_names (GncTreeViewAccount *view) /* Translators: %s is a currency mnemonic.*/ _("Present (%s)"), mnemonic); gtva_update_column_name(view->balance_report_column, - /* Translators: %s is a currency mnemonic and this is a column header.*/ + /* Translators: %s is a currency mnemonic.*/ _("Balance (%s)"), mnemonic); gtva_update_column_name(view->cleared_report_column, /* Translators: %s is a currency mnemonic.*/ diff --git a/gnucash/gnome-utils/gnc-tree-view-owner.c b/gnucash/gnome-utils/gnc-tree-view-owner.c index 291ca34d70f..d1b1762845c 100644 --- a/gnucash/gnome-utils/gnc-tree-view-owner.c +++ b/gnucash/gnome-utils/gnc-tree-view-owner.c @@ -436,22 +436,20 @@ gnc_tree_view_owner_new (GncOwnerType owner_type) GNC_TREE_MODEL_OWNER_COL_EMAIL, GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, sort_by_string); - gnc_tree_view_add_numeric_column(GNC_TREE_VIEW(view), C_("column header", "Balance"), - GNC_OWNER_TREE_BALANCE_COL, + gnc_tree_view_add_numeric_column(GNC_TREE_VIEW(view), _("Balance"), GNC_OWNER_TREE_BALANCE_COL, SAMPLE_OWNER_VALUE, GNC_TREE_MODEL_OWNER_COL_BALANCE, GNC_TREE_MODEL_OWNER_COL_COLOR_BALANCE, GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, sort_by_balance_value); - view->balance_report_column = - gnc_tree_view_add_numeric_column(GNC_TREE_VIEW(view), C_("column header", "Balance"), - GNC_OWNER_TREE_BALANCE_REPORT_COL, - SAMPLE_OWNER_VALUE, - GNC_TREE_MODEL_OWNER_COL_BALANCE_REPORT, - GNC_TREE_MODEL_OWNER_COL_COLOR_BALANCE, - GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, - sort_by_balance_value); + view->balance_report_column + = gnc_tree_view_add_numeric_column(GNC_TREE_VIEW(view), _("Balance"), GNC_OWNER_TREE_BALANCE_REPORT_COL, + SAMPLE_OWNER_VALUE, + GNC_TREE_MODEL_OWNER_COL_BALANCE_REPORT, + GNC_TREE_MODEL_OWNER_COL_COLOR_BALANCE, + GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, + sort_by_balance_value); view->notes_column = gnc_tree_view_add_text_column(GNC_TREE_VIEW(view), _("Notes"), GNC_OWNER_TREE_NOTES_COL, NULL, @@ -895,7 +893,7 @@ gtvo_update_column_names (GncTreeViewOwner *view) const gchar *mnemonic = gnc_commodity_get_mnemonic(gnc_default_report_currency()); gtvo_update_column_name(view->balance_report_column, - /* Translators: %s is a currency mnemonic and this is a column header.*/ + /* Translators: %s is a currency mnemonic.*/ _("Balance (%s)"), mnemonic); gnc_tree_view_set_show_column_menu(GNC_TREE_VIEW(view), FALSE); gnc_tree_view_set_show_column_menu(GNC_TREE_VIEW(view), TRUE); diff --git a/gnucash/gnome/dialog-lot-viewer.c b/gnucash/gnome/dialog-lot-viewer.c index 4f0ffb57764..cf1d4a69cae 100644 --- a/gnucash/gnome/dialog-lot-viewer.c +++ b/gnucash/gnome/dialog-lot-viewer.c @@ -938,7 +938,7 @@ lv_init_lot_view (GNCLotViewer *lv) gtk_tree_view_append_column(view, column); renderer = gtk_cell_renderer_text_new(); - column = gtk_tree_view_column_new_with_attributes(C_("column heading", "Balance"), renderer, + column = gtk_tree_view_column_new_with_attributes(_("Balance"), renderer, "text", LOT_COL_BALN, NULL); configure_number_columns (column, renderer, LOT_COL_BALN_DOUBLE); gtk_tree_view_append_column(view, column); @@ -1030,7 +1030,7 @@ lv_init_split_view (GNCLotViewer *lv, GtkTreeView *view) gtk_tree_view_append_column(view, column); renderer = gtk_cell_renderer_text_new(); - column = gtk_tree_view_column_new_with_attributes(C_("column header", "Balance"), renderer, + column = gtk_tree_view_column_new_with_attributes(_("Balance"), renderer, "text", SPLIT_COL_BALANCE, NULL); configure_number_columns (column, renderer, SPLIT_COL_BALANCE_DOUBLE); gtk_tree_view_append_column(view, column); diff --git a/gnucash/gtkbuilder/dialog-account.glade b/gnucash/gtkbuilder/dialog-account.glade index 3a97c0d15db..bf96496b95c 100644 --- a/gnucash/gtkbuilder/dialog-account.glade +++ b/gnucash/gtkbuilder/dialog-account.glade @@ -1834,7 +1834,7 @@ Clear the entry to have no warning. True False end - _Balance + _Balance True right diff --git a/gnucash/ui/gnc-reconcile-window.ui b/gnucash/ui/gnc-reconcile-window.ui index 629b73e0a62..9f2a1f88b74 100644 --- a/gnucash/ui/gnc-reconcile-window.ui +++ b/gnucash/ui/gnc-reconcile-window.ui @@ -95,7 +95,7 @@ - _Balance + _Balance recwin.TransBalanceAction @@ -126,7 +126,7 @@ False Add a new balancing entry to the account recwin.TransBalanceAction - _Balance + _Balance True document-new