From 08d868865af663497363fb4f8cf9eaf3c351daf0 Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Sun, 16 May 2021 05:17:54 +0200 Subject: [PATCH 1/8] I18N: Improvements w/o translator interaction like comments and duplicates --- gnucash/gnome-utils/dialog-commodity.c | 2 +- gnucash/gtkbuilder/dialog-doclink.glade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gnucash/gnome-utils/dialog-commodity.c b/gnucash/gnome-utils/dialog-commodity.c index e5474c38023..3c394e030d3 100644 --- a/gnucash/gnome-utils/dialog-commodity.c +++ b/gnucash/gnome-utils/dialog-commodity.c @@ -169,7 +169,7 @@ gnc_ui_select_commodity_modal_full(gnc_commodity * orig_sel, /* Translators: Replace here and later CUSIP by the name of your local National Securities Identifying Number like gb:SEDOL, de:WKN, ch:Valorennummer, fr:SICOVAM ... - See http://en.wikipedia.org/wiki/ISIN and + See https://en.wikipedia.org/wiki/ISIN and https://en.wikipedia.org/wiki/National_numbering_agency for hints. */ cusip ? _("\nExchange code (ISIN, CUSIP or similar): ") : "", cusip ? cusip : "", diff --git a/gnucash/gtkbuilder/dialog-doclink.glade b/gnucash/gtkbuilder/dialog-doclink.glade index 13dc36051a6..bb043aafba1 100644 --- a/gnucash/gtkbuilder/dialog-doclink.glade +++ b/gnucash/gtkbuilder/dialog-doclink.glade @@ -343,7 +343,7 @@ True False start - (None) + (none) True From 8e259c8aa79ee03fb87e9744e26f837c708b289e Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Tue, 7 Feb 2023 00:17:03 +0100 Subject: [PATCH 2/8] Improve legibility of a message in the sources --- gnucash/gnome/dialog-payment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnucash/gnome/dialog-payment.c b/gnucash/gnome/dialog-payment.c index cbd2dd21f3a..3209376a01f 100644 --- a/gnucash/gnome/dialog-payment.c +++ b/gnucash/gnome/dialog-payment.c @@ -1632,7 +1632,8 @@ static Split *select_payment_split (GtkWindow *parent, Transaction *txn) GList *node; GtkWidget *first_rb = NULL; int answer = GTK_BUTTONS_OK; - const char *message = _("While this transaction has multiple splits that can be considered\nas 'the payment split', GnuCash only knows how to handle one.\n" + const char *message = _("While this transaction has multiple splits that can be considered\n" + "as 'the payment split', GnuCash only knows how to handle one.\n" "Please select one, the others will be discarded.\n\n"); GtkDialog *dialog = GTK_DIALOG( gtk_dialog_new_with_buttons (_("Warning"), From 81db38f47377797281c33476869a9404c790c26f Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Sun, 16 May 2021 05:17:54 +0200 Subject: [PATCH 3/8] I18N: mixed improvements like http -> https --- gnucash/gnome/dialog-doclink.c | 6 +++--- gnucash/gtkbuilder/dialog-doclink.glade | 2 +- gnucash/import-export/qif-imp/qif-parse.scm | 8 ++++++-- gnucash/report/reports/example/welcome-to-gnucash.scm | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gnucash/gnome/dialog-doclink.c b/gnucash/gnome/dialog-doclink.c index 3250e6c2f92..65a49c08589 100644 --- a/gnucash/gnome/dialog-doclink.c +++ b/gnucash/gnome/dialog-doclink.c @@ -238,11 +238,11 @@ setup_location_dialog (GtkBuilder *builder, GtkWidget *button_loc, const gchar * // update label and set entry text if required if (uri) { - gtk_label_set_text (location_label, _("Amend URL:")); + gtk_label_set_text (location_label, _("Amend the URL")); gtk_entry_set_text (entry, uri); } else - gtk_label_set_text (location_label, _("Enter URL like http://www.gnucash.org:")); + gtk_label_set_text (location_label, _("Enter an URL like \"https://www.gnucash.org\"")); } static void @@ -256,7 +256,7 @@ setup_file_dialog (GtkBuilder *builder, const gchar *path_head, const gchar *uri GtkWidget *existing_hbox = GTK_WIDGET(gtk_builder_get_object (builder, "existing_hbox")); GtkWidget *image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_SMALL_TOOLBAR); gchar *use_uri = gnc_doclink_get_use_uri (path_head, uri, scheme); - gchar *uri_label = g_strdup_printf ("%s '%s'", _("Existing Document Link is"), display_uri); + gchar *uri_label = g_strdup_printf ("%s \"%s\"", _("Existing Document Link is"), display_uri); GtkWidget *label = gtk_label_new (uri_label); if (g_file_test (display_uri, G_FILE_TEST_EXISTS)) diff --git a/gnucash/gtkbuilder/dialog-doclink.glade b/gnucash/gtkbuilder/dialog-doclink.glade index bb043aafba1..c03da4a3e8e 100644 --- a/gnucash/gtkbuilder/dialog-doclink.glade +++ b/gnucash/gtkbuilder/dialog-doclink.glade @@ -406,7 +406,7 @@ start 3 3 - Enter URL like http://www.gnucash.org + Enter an URL like "https://www.gnucash.org" False diff --git a/gnucash/import-export/qif-imp/qif-parse.scm b/gnucash/import-export/qif-imp/qif-parse.scm index 0645a6de94e..147c56a2c2f 100644 --- a/gnucash/import-export/qif-imp/qif-parse.scm +++ b/gnucash/import-export/qif-imp/qif-parse.scm @@ -169,7 +169,9 @@ (list "oth s" GNC-ASSET-TYPE GNC-BANK-TYPE GNC-CASH-TYPE) (list "mutual" GNC-BANK-TYPE))) (or (assoc-ref string-map-alist (string-downcase! (string-trim-both read-value))) - (let ((msg (format #f (G_ "Unrecognized account type '~s'. Defaulting to Bank.") + ;; Translators: Mapping the QIF account type to a GnuCash account type. + ;; see https://en.wikipedia.org/wiki/Quicken_Interchange_Format#Detail_items + (let ((msg (format #f (G_ "The account type ~s is unknown, using 'bank' instead.") read-value))) (errorproc errortype msg) (list GNC-BANK-TYPE)))) @@ -232,6 +234,7 @@ (and read-value (let ((sym (string->symbol (string-downcase (string-trim-both read-value))))) (or (any (lambda (lst) (and (memq sym lst) (car lst))) action-map) + ;; Translators: This is an error message about actions like buy, sell … (let ((msg (format #f (G_ "Unrecognized action '~a'.") read-value))) (errorproc errortype msg)))))) @@ -251,7 +254,8 @@ (not (string-null? read-value)) (let* ((secondchar (string-ref read-value 0))) (or (any (lambda (m) (and (memq secondchar (cdr m)) (car m))) maplist) - (let ((msg (format #f (G_ "Unrecognized status '~a'. Defaulting to uncleared.") + ;; Translators: Error message about reconciliation status, see msgctxt "Reconciled flag …" + (let ((msg (format #f (G_ "The unknown reconciliation status '~a' will be replaced by 'uncleared'.") read-value))) (errorproc errortype msg)))))) diff --git a/gnucash/report/reports/example/welcome-to-gnucash.scm b/gnucash/report/reports/example/welcome-to-gnucash.scm index 80a2e076876..dab47003c67 100644 --- a/gnucash/report/reports/example/welcome-to-gnucash.scm +++ b/gnucash/report/reports/example/welcome-to-gnucash.scm @@ -38,7 +38,7 @@ doc (gnc:make-html-text (gnc:html-markup-h3 - (format #f (G_ "Welcome to GnuCash ~a !") + (format #f (G_ "Welcome to GnuCash ~a!") gnc:version)) (gnc:html-markup-p (format #f (G_ "GnuCash ~a has lots of nice features. Here are a few.") From bdb12fd94f250da213f4f41a1bfa3458c04bf07f Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Thu, 12 Aug 2021 20:58:19 +0200 Subject: [PATCH 4/8] I18N: Change TaxTable to "Tax Table" for consistency --- libgnucash/app-utils/business-prefs.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgnucash/app-utils/business-prefs.scm b/libgnucash/app-utils/business-prefs.scm index 9e50ae3c12a..1c4db2948c1 100644 --- a/libgnucash/app-utils/business-prefs.scm +++ b/libgnucash/app-utils/business-prefs.scm @@ -118,13 +118,13 @@ (reg-option (gnc:make-taxtable-option - gnc:*business-label* (N_ "Default Customer TaxTable") + gnc:*business-label* (N_ "Default Customer Tax Table") "e" (N_ "The default tax table to apply to customers.") (lambda () '()) #f)) (reg-option (gnc:make-taxtable-option - gnc:*business-label* (N_ "Default Vendor TaxTable") + gnc:*business-label* (N_ "Default Vendor Tax Table") "f" (N_ "The default tax table to apply to vendors.") (lambda () '()) #f)) From b2867e432b4a3ec9bec52a56aa00b0611af05711 Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Sat, 11 Sep 2021 02:14:19 +0200 Subject: [PATCH 5/8] drop some hardcoded linefeeds from translatable strings --- .../gtkbuilder/assistant-acct-period.glade | 3 +- .../assistant-csv-account-import.glade | 4 +- gnucash/gtkbuilder/assistant-csv-export.glade | 4 +- gnucash/gtkbuilder/assistant-hierarchy.glade | 9 +- gnucash/gtkbuilder/assistant-loan.glade | 17 ++- gnucash/gtkbuilder/assistant-qif-import.glade | 3 +- gnucash/gtkbuilder/dialog-custom-report.glade | 12 +- .../bi-import/dialog-bi-import.c | 110 +++++++++--------- 8 files changed, 75 insertions(+), 87 deletions(-) diff --git a/gnucash/gtkbuilder/assistant-acct-period.glade b/gnucash/gtkbuilder/assistant-acct-period.glade index 938ffdf47fd..106a8b590b6 100644 --- a/gnucash/gtkbuilder/assistant-acct-period.glade +++ b/gnucash/gtkbuilder/assistant-acct-period.glade @@ -35,8 +35,7 @@ Danger: this feature does not work correctly at this time; it is still under dev True False - -Select an accounting period and the closing date which must not be in the future and is greater than the closing date of the previous book. + Select an accounting period and the closing date which must not be in the future, but is greater than the closing date of the previous book. Books will be closed at midnight on the selected date. center diff --git a/gnucash/gtkbuilder/assistant-csv-account-import.glade b/gnucash/gtkbuilder/assistant-csv-account-import.glade index d1e6184c4b7..dcad4f1d8db 100644 --- a/gnucash/gtkbuilder/assistant-csv-account-import.glade +++ b/gnucash/gtkbuilder/assistant-csv-account-import.glade @@ -63,9 +63,7 @@ Click on "Next" to proceed or "Cancel" to Abort Import. True False - -Enter file name and location for the Import... - + Enter file name and location for the Import… True diff --git a/gnucash/gtkbuilder/assistant-csv-export.glade b/gnucash/gtkbuilder/assistant-csv-export.glade index 58893a08b2a..cc822f30851 100644 --- a/gnucash/gtkbuilder/assistant-csv-export.glade +++ b/gnucash/gtkbuilder/assistant-csv-export.glade @@ -684,9 +684,7 @@ Select the type of Export required and the separator that will be used. True False - -Enter file name and location for the Export... - + Enter file name and location for the Export… True diff --git a/gnucash/gtkbuilder/assistant-hierarchy.glade b/gnucash/gtkbuilder/assistant-hierarchy.glade index b11baa8ffc4..7bd46bd1517 100644 --- a/gnucash/gtkbuilder/assistant-hierarchy.glade +++ b/gnucash/gtkbuilder/assistant-hierarchy.glade @@ -41,8 +41,7 @@ Click 'Cancel' if you do not wish to create any new accounts now. True False - -Please choose the currency to use for new accounts. + Please choose the currency to use for new accounts. False @@ -528,15 +527,13 @@ Please choose the currency to use for new accounts. False 12 12 - -If you would like to change an account's name, click on the row containing the account, then click on the account name and change it. + If you would like to change an account's name, click on the row containing the account, then click on the account name and change it. Some accounts are marked as "Placeholder". Placeholder accounts are used to create a hierarchy of accounts and normally do not have transactions or opening balances. If you would like an account to be a placeholder account, click the checkbox for that account. If you would like an account to have an opening balance, click on the row containing the account, then click on the opening balance field and enter the starting balance. -<b>Note:</b> all accounts except Equity and placeholder accounts may have an opening balance. - +<b>Note:</b> all accounts except Equity and placeholder accounts may have an opening balance. True True 75 diff --git a/gnucash/gtkbuilder/assistant-loan.glade b/gnucash/gtkbuilder/assistant-loan.glade index 7564c674ccb..cc1c7623c40 100644 --- a/gnucash/gtkbuilder/assistant-loan.glade +++ b/gnucash/gtkbuilder/assistant-loan.glade @@ -448,8 +448,7 @@ If you make a mistake or want to make changes later, you can edit the created Sc False center 12 - -Do you utilise an escrow account, if so an account must be specified... + Do you utilise an escrow account, if so an account must be specified… center True @@ -542,11 +541,12 @@ Do you utilise an escrow account, if so an account must be specified... True False - -All accounts must have valid entries to continue. - + All accounts must have valid entries to continue. center True + False @@ -724,9 +724,7 @@ All accounts must have valid entries to continue. True False - -All enabled option pages must contain valid entries to continue. - + All enabled option pages must contain valid entries to continue. center @@ -1080,8 +1078,7 @@ All enabled option pages must contain valid entries to continue. True False - -Review the details below and if correct press Apply to create the schedule. + Review the details below and if correct press "Apply"" to create the schedule. center diff --git a/gnucash/gtkbuilder/assistant-qif-import.glade b/gnucash/gtkbuilder/assistant-qif-import.glade index 68012c75987..987d95b860c 100644 --- a/gnucash/gtkbuilder/assistant-qif-import.glade +++ b/gnucash/gtkbuilder/assistant-qif-import.glade @@ -1208,8 +1208,7 @@ If you don't see your exchange listed, or none of the available choices are appr True False - -If you are importing a QIF file from a bank or other financial institution, some of the transactions may already exist in your GnuCash accounts. To avoid duplication, GnuCash has tried to identify matches and needs your help to review them. + If you are importing a QIF file from a bank or other financial institution, some of the transactions may already exist in your GnuCash accounts. To avoid duplication, GnuCash has tried to identify matches and needs your help to review them. On the next page you will be shown a list of imported transactions. As you select each one, a list of possible matches will be shown below it. If you find a correct match, click on it. Your selection will be confirmed by a check mark in the "Match?" column. diff --git a/gnucash/gtkbuilder/dialog-custom-report.glade b/gnucash/gtkbuilder/dialog-custom-report.glade index b80b1c2698c..1f9f03f0558 100644 --- a/gnucash/gtkbuilder/dialog-custom-report.glade +++ b/gnucash/gtkbuilder/dialog-custom-report.glade @@ -97,9 +97,7 @@ False - -Currently you have no saved reports. - + Currently you have no saved reports. True @@ -111,9 +109,11 @@ Currently you have no saved reports. True False - Saved report configurations are created by first opening a report from the Reports menu, -altering the report's options to your taste and then choosing "Save Report Configuration" from -the Reports menu or tool bar. + Saved report configurations are created by +1. opening a report from the Reports menu, +2. altering the report's options to your taste, +3. selecting "Save Report Configuration [As…]" from the Reports menu + or pressing a "Save Config [As…]" button on the tool bar. False diff --git a/gnucash/import-export/bi-import/dialog-bi-import.c b/gnucash/import-export/bi-import/dialog-bi-import.c index 03003e1534a..d2b5566db40 100644 --- a/gnucash/import-export/bi-import/dialog-bi-import.c +++ b/gnucash/import-export/bi-import/dialog-bi-import.c @@ -74,23 +74,23 @@ static QofLogModule log_module = G_LOG_DOMAIN; //G_LOG_BUSINESS; static char * un_escape(char *str); /** \brief Imports a csv file with invoice data into a GtkListStore. - + Opens the csv file and attempts to match each row with the regular expression provided in parser_regexp. This is a regular expression that matches each field of the import row and the user selected field separators (, or ;), optionally with the fields enclosed in quotes. - + If the match is successful, the fields of the import row are transferred to a row in the GtkListStore store. If the match is not successful, the row is ignored. Maintains information about number of rows imported, the number of rows ignored, and the actual ignored rows. - + @param filename The csv filename to read @param parser_regexp The regular expression with which to match the import rows @param store To store the matched data @param max_rows The maximum number of rows to import; use 0 for no maximum. @param stats Return information about matched and non-matched rows. Use NULL if the information is not required. - + */ bi_import_result @@ -236,13 +236,13 @@ gnc_bi_import_read_file (const gchar * filename, const gchar * parser_regexp, /** \brief Adjusts and validates invoice import data. - + Replaces missing or invalid data with defaults: - if quantity is not set, default to 1 - if date_opened is not set or invalid, default to today - if date is not set or invalid, default to date_opened - if due date is not set or invalid, default to date_posted - + Validates the import data; any error causes all rows of the same invoice to be deleted from the import data: - id is not set, and there is no previous id @@ -252,17 +252,17 @@ gnc_bi_import_read_file (const gchar * filename, const gchar * parser_regexp, - account posted is not the applicable type, A/P or A/R - price is not set - account does not exist - + Adjustment and validation for header fields is only done for the first row of an invoice, which is assumed to hold the header data for all items of the same invoice. Currency related validation is done in subsqequent processing by gnc_bi_import_create_bis. - + @param store Holds the rows of invoice import data @param n_rows_fixed Increased for every data row that is adjusted in this function @param n_rows_ignored Increased for every data row that is deleted in this function @param info Updated with the error messages from this function @param type The type of the import data, BILL or INVOICE - + */ void @@ -288,12 +288,12 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row *n_rows_fixed = 0; *n_rows_ignored = 0; - + // Init control variables running_id = g_string_new(""); ignore_invoice = FALSE; on_first_row_of_invoice = TRUE; - + g_string_append_printf (info, _("Validation...\n") ); // Walk through the list, reading each row. @@ -313,10 +313,10 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row DUE_DATE, &due_date, ACCOUNT_POSTED, &account_posted, OWNER_ID, &owner_id, -1); - + g_string_assign (running_id, id); first_row_of_invoice = iter; - + // Validate the invoice id. if (strlen (id) == 0) { @@ -360,7 +360,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row row, id, invoice_line, owner_id); } } - + if (strlen(date_posted) != 0) { // Validate the date posted and due date. @@ -371,7 +371,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row g_string_append_printf (info, _("Row %d, invoice %s/%u: %s is not a valid posting date.\n"), row, id, invoice_line, date_posted); - + // Verify the due date. if (!isDateValid(due_date)) { @@ -392,7 +392,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row row_fixed = TRUE; } } - + // Validate account posted. // Account should exists, and should be of type A/R for invoices, A/P for bills. acc = gnc_account_lookup_for_register @@ -408,7 +408,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row { if (g_ascii_strcasecmp (type, "BILL") == 0) { - + if (xaccAccountGetType (acc) != ACCT_TYPE_PAYABLE) { ignore_invoice = TRUE; @@ -429,7 +429,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row } } } - + // Verify the date opened. if(!isDateValid(date_opened)) { @@ -444,9 +444,9 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row row_fixed = TRUE; } } - + // Validate and fix item data for each row. - + // Get item data. gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, DATE, &date, @@ -454,7 +454,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row QUANTITY, &quantity, PRICE, &price, -1); - + // Validate the price. if (strlen (price) == 0) { @@ -475,11 +475,11 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row _("Row %d, invoice %s/%u: account %s does not exist.\n"), row, id, invoice_line, account); } - + // Fix item data. if (!ignore_invoice) { - + // Verify the quantity. if (strlen (quantity) == 0) { @@ -487,7 +487,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row gtk_list_store_set (store, &iter, QUANTITY, "1", -1); row_fixed = TRUE; } - + // Verify the item date if(!isDateValid(date)) { @@ -499,19 +499,19 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row } if (row_fixed) ++fixed_for_invoice; - + // Get the next row and its id. valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter); if (valid) gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, ID, &id, -1); - + // If the id of the next row is blank, it takes the id of the previous row. if (valid && strlen(id) == 0) { strcpy( id, running_id->str); gtk_list_store_set (store, &iter, ID, id, -1); } - + // If this row was the last row of the invoice... if (!valid || (valid && g_strcmp0 (id, running_id->str) != 0)) { @@ -526,7 +526,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row if (valid) gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, ID, &id, -1); } while (valid && (g_strcmp0 (id, running_id->str) == 0)); - + if (running_id->len != 0) { g_string_append_printf (info, @@ -538,18 +538,18 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row g_string_append_printf (info, _("Error(s) in invoice without id, all rows of this invoice ignored.\n")); } - + // Fixes for ignored invoices don't count in the statistics. fixed_for_invoice = 0; - + ignore_invoice = FALSE; } - + on_first_row_of_invoice = TRUE; (*n_rows_fixed) += fixed_for_invoice; fixed_for_invoice = 0; invoice_line = 0; - + g_free (id); g_free (date_opened); g_free (date_posted); @@ -558,7 +558,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row g_free (owner_id); } else on_first_row_of_invoice = FALSE; - + g_free (date); g_free (account); g_free (quantity); @@ -566,7 +566,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row row++; } - + // Deallocate strings. g_string_free (running_id, TRUE); @@ -574,24 +574,24 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * n_rows_fixed, guint * n_row /** \brief Creates and updates invoices from validated import data. - + Loops through the import data to create and update invoices. The first data row for an invoice is assumed to hold the header data. - + If an invoice already exists, the user is asked, once per import, to confirm that invoices should be updated. If not confirmed, any rows for existing invoices are ignored. If confirmed, entries are added to existing invoices. Posted invoices, however, are never updated. - + If the field date_posted is set, the system will attempt to also post the invoice. The system will not post the invoice if the entries of the invoice hold different currencies, or if the currency of the invoice differs from the currency of the account_posted. - + As per user selection, the system displays tabs for either all affected invoices, all affected invoices not yet posted, or no invoices at all. - + */ void @@ -643,9 +643,9 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book, update = NOT_ASKED; on_first_row_of_invoice = TRUE; running_id = g_string_new(""); - - g_string_append_printf (info, _("\nProcessing...\n") ); - + + g_string_append_printf (info, "\n%s\n", _("Processing…") ); + valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter); while (valid) { @@ -673,12 +673,12 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book, TAXABLE, &taxable, TAXINCLUDED, &taxincluded, TAX_TABLE, &tax_table, -1); - + if (on_first_row_of_invoice) { g_string_assign(running_id, id); first_row_of_invoice = iter; - + if (g_ascii_strcasecmp (type, "BILL") == 0) invoice = gnc_search_bill_on_id (book, id); else if (g_ascii_strcasecmp (type, "INVOICE") == 0) @@ -714,7 +714,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book, //if (g_ascii_strcasecmp(type,"INVOICE"))gncInvoiceSetBillTo( invoice, billto ); (*n_invoices_created)++; g_string_append_printf (info, _("Invoice %s created.\n"),id); - + gncInvoiceCommitEdit (invoice); } else // Dealing with an existing invoice. @@ -732,7 +732,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book, update = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } - + if (update == NO) { // If the user does not want to update existing invoices, ignore all rows of the invoice. @@ -747,7 +747,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book, on_first_row_of_invoice = TRUE; continue; } - + if (gncInvoiceIsPosted (invoice)) { // If the invoice is already posted, ignore all rows of the invoice. @@ -786,7 +786,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book, notes = un_escape(notes); gncEntrySetDescription (entry, desc); gncEntrySetAction (entry, action); - value = gnc_numeric_zero(); + value = gnc_numeric_zero(); gnc_exp_parser_parse (quantity, &value, NULL); gncEntrySetQuantity (entry, value); acc = gnc_account_lookup_for_register (gnc_get_current_root_account (), @@ -823,12 +823,12 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book, gncEntryCommitEdit(entry); valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter); // handle auto posting of invoices - + if (valid) gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, ID, &id, -1); else id = NULL; - + if (g_strcmp0 (id, running_id->str) == 0) // The next row is for the same invoice. { on_first_row_of_invoice = FALSE; @@ -901,7 +901,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book, { PWARN("Invoice %s is NOT marked for posting",id); } - + // open new bill / invoice in a tab, if requested if (g_ascii_strcasecmp(open_mode, "ALL") == 0 || (g_ascii_strcasecmp(open_mode, "NOT_POSTED") == 0 @@ -910,15 +910,15 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book, iw = gnc_ui_invoice_edit (parent, invoice); gnc_plugin_page_invoice_new (iw); } - + // The next row will be for a new invoice. on_first_row_of_invoice = TRUE; } } - + if (*n_invoices_updated + *n_invoices_created == 0) g_string_append_printf (info, _("Nothing to process.\n")); - + // cleanup g_free (id); g_free (date_opened); @@ -942,7 +942,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book, g_free (account_posted); g_free (memo_posted); g_free (accumulatesplits); - + g_string_free (running_id, TRUE); } From bb94c1c9095d96a8a9ef86a6df48420843782f77 Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Fri, 19 Aug 2022 19:00:51 +0200 Subject: [PATCH 6/8] doclink: use PACKAGE_URL --- gnucash/gnome/dialog-doclink.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnucash/gnome/dialog-doclink.c b/gnucash/gnome/dialog-doclink.c index 65a49c08589..180ddc07dfe 100644 --- a/gnucash/gnome/dialog-doclink.c +++ b/gnucash/gnome/dialog-doclink.c @@ -242,7 +242,12 @@ setup_location_dialog (GtkBuilder *builder, GtkWidget *button_loc, const gchar * gtk_entry_set_text (entry, uri); } else - gtk_label_set_text (location_label, _("Enter an URL like \"https://www.gnucash.org\"")); + { + gchar *enter_uri = g_strdup_printf (_("Enter an URL like \"%s\""), + PACKAGE_URL); + gtk_label_set_text (location_label, enter_uri); + g_free (enter_uri); + } } static void From 6615051c59c03cb9a7165ff41e13da8c425dd5ac Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Sat, 4 Feb 2023 03:43:43 +0100 Subject: [PATCH 7/8] Fix several ellipses --- gnucash/gnome-utils/gnc-main-window.c | 2 +- gnucash/gnome/gnc-plugin-basic-commands.c | 4 ++-- gnucash/gnome/gnc-plugin-page-report.c | 2 +- gnucash/import-export/aqb/gnc-plugin-aqbanking.c | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c index 51890edfde8..3f824d4c228 100644 --- a/gnucash/gnome-utils/gnc-main-window.c +++ b/gnucash/gnome-utils/gnc-main-window.c @@ -297,7 +297,7 @@ static GtkActionEntry gnc_menu_actions [] = # define GTK_STOCK_PAGE_SETUP NULL #endif { - "FilePageSetupAction", "document-page-setup", N_("Pa_ge Setup..."), "p", + "FilePageSetupAction", "document-page-setup", N_("Pa_ge Setup"), "p", N_("Specify the page size and orientation for printing"), G_CALLBACK (gnc_main_window_cmd_page_setup) }, diff --git a/gnucash/gnome/gnc-plugin-basic-commands.c b/gnucash/gnome/gnc-plugin-basic-commands.c index 41c1338d195..ef6037ce6ed 100644 --- a/gnucash/gnome/gnc-plugin-basic-commands.c +++ b/gnucash/gnome/gnc-plugin-basic-commands.c @@ -135,7 +135,7 @@ static GtkActionEntry gnc_plugin_actions [] = }, { "FileExportAccountsAction", "go-next", - N_("Export _Accounts"), NULL, + N_("Export _Accounts…"), NULL, N_("Export the account hierarchy to a new GnuCash datafile"), G_CALLBACK (gnc_main_window_cmd_file_export_accounts) }, @@ -204,7 +204,7 @@ static GtkActionEntry gnc_plugin_actions [] = G_CALLBACK (gnc_main_window_cmd_tools_financial_calculator) }, { - "ToolsBookCloseAction", NULL, N_("_Close Book"), NULL, + "ToolsBookCloseAction", NULL, N_("_Close Book…"), NULL, N_("Close the Book at the end of the Period"), G_CALLBACK (gnc_main_window_cmd_tools_close_book) }, diff --git a/gnucash/gnome/gnc-plugin-page-report.c b/gnucash/gnome/gnc-plugin-page-report.c index 09bdb946bdb..f38a8823361 100644 --- a/gnucash/gnome/gnc-plugin-page-report.c +++ b/gnucash/gnome/gnc-plugin-page-report.c @@ -1247,7 +1247,7 @@ gnc_plugin_page_report_constr_init(GncPluginPageReport *plugin_page, gint report report_saveas_str, G_CALLBACK(gnc_plugin_page_report_save_as_cb) }, { - "ReportExportAction", "go-next", N_("Export _Report"), NULL, + "ReportExportAction", "go-next", N_("Export _Report…"), NULL, N_("Export HTML-formatted report to file"), G_CALLBACK(gnc_plugin_page_report_export_cb) }, diff --git a/gnucash/import-export/aqb/gnc-plugin-aqbanking.c b/gnucash/import-export/aqb/gnc-plugin-aqbanking.c index 51592b796e1..f066fb6d7cf 100644 --- a/gnucash/import-export/aqb/gnc-plugin-aqbanking.c +++ b/gnucash/import-export/aqb/gnc-plugin-aqbanking.c @@ -137,12 +137,12 @@ static GtkActionEntry gnc_plugin_actions [] = "Mt940ImportAction", "go-previous", /* Translators: Message types MTxxxx are exchange formats used by the SWIFT network https://en.wikipedia.org/wiki/Society_for_Worldwide_Interbank_Financial_Telecommunication */ - N_("Import _MT940"), NULL, + N_("Import _MT940…"), NULL, N_("Import an end-of-day account statement in SWIFT MT940 format into GnuCash."), G_CALLBACK(gnc_plugin_ab_cmd_mt940_import) }, { - "Mt942ImportAction", "go-previous", N_("Import MT94_2"), NULL, + "Mt942ImportAction", "go-previous", N_("Import MT94_2…"), NULL, N_("Import an interim account statement in SWIFT MT942 format into GnuCash."), G_CALLBACK(gnc_plugin_ab_cmd_mt942_import) }, @@ -150,7 +150,7 @@ static GtkActionEntry gnc_plugin_actions [] = "DtausImportAction", "go-previous", /* Translators: DTAUS is a traditional german exchange format. https://de.wikipedia.org/wiki/Datentr%C3%A4geraustauschverfahren */ - N_("Import _DTAUS"), NULL, + N_("Import _DTAUS…"), NULL, N_("Import a traditional german DTAUS file into GnuCash."), G_CALLBACK(gnc_plugin_ab_cmd_dtaus_import) }, @@ -163,7 +163,7 @@ static GtkActionEntry gnc_plugin_actions [] = /* G_CALLBACK(gnc_plugin_ab_cmd_csv_importsend) }, */ /* #endif */ { - "DtausImportSendAction", "go-previous", N_("Import DTAUS and _send..."), NULL, + "DtausImportSendAction", "go-previous", N_("Import DTAUS and _send…"), NULL, N_("Import a DTAUS file into GnuCash and transmit its orders by Online Banking."), G_CALLBACK(gnc_plugin_ab_cmd_dtaus_importsend) }, From 931b1023129f34bb154ea12f441d5f8db6c00b9d Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 2 Mar 2023 15:56:52 -0800 Subject: [PATCH 8/8] [stock-txn-asst] Enable translations, slightly fewer strings. Remove context from strings that are mostly unique to the assistant. --- gnucash/gnome/assistant-stock-transaction.cpp | 46 +++++++++++++------ po/POTFILES.ignore | 2 - po/POTFILES.in | 2 + 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp index 077ef428a23..6f87efeacd7 100644 --- a/gnucash/gnome/assistant-stock-transaction.cpp +++ b/gnucash/gnome/assistant-stock-transaction.cpp @@ -601,7 +601,9 @@ static void add_error (StringVec& errors, const char* format_str, const char* arg) { gchar *buf = g_strdup_printf (_(format_str), - g_dpgettext2 (nullptr, "Stock Assistant: Page name", arg)); + g_strcmp0("Cash", arg) ? + _(arg) : + g_dpgettext2 (nullptr, "Stock Assistant", arg)); errors.emplace_back (buf); g_free (buf); } @@ -756,7 +758,9 @@ to ensure proper recording."), new_date_str, last_split_date_str); else check_page (line, debit, credit, info->txn_type->stock_value, info->acct, info->stock_memo_edit, info->stock_value_edit, info->currency, - NC_ ("Stock Assistant: Page name", "stock value"), errors); + // Translators: Designates the page in the Stock Assistant for entering + // the currency value of a non-currency asset. + N_ ("Stock Value"), errors); if (info->txn_type->stock_amount == FieldMask::DISABLED) @@ -826,7 +830,9 @@ to ensure proper recording."), new_date_str, last_split_date_str); check_page (line, debit, credit, info->txn_type->cash_value, gas_account (info->cash_account), info->cash_memo_edit, info->cash_value, info->currency, - NC_ ("Stock Assistant: Page name", "cash"), errors); +// Translators: Designates a page in the stock assistant or inserts the value +// into the non-currency asset split of an investment transaction. + NC_ ("Stock Assistant", "Cash"), errors); add_to_summary_table (list, line); } @@ -837,7 +843,9 @@ to ensure proper recording."), new_date_str, last_split_date_str); check_page (line, debit, credit, info->txn_type->fees_value, capitalize_fees ? info->acct : gas_account (info->fees_account), info->fees_memo_edit, info->fees_value, info->currency, - NC_ ("Stock Assistant: Page name", "fees"), errors); +// Translators: Designates a page in the stock assistant or inserts the value +// into the fees split of an investment transaction. + N_ ("Fees"), errors); if (!line.value_is_zero) add_to_summary_table (list, line); } @@ -847,7 +855,9 @@ to ensure proper recording."), new_date_str, last_split_date_str); check_page (line, debit, credit, info->txn_type->dividend_value, gas_account (info->dividend_account), info->dividend_memo_edit, info->dividend_value, info->currency, - NC_ ("Stock Assistant: Page name", "dividend"), errors); +// Translators: Designates a page in the stock assistant or inserts the value +// into the income split of an investment dividend transaction. + N_ ("Dividend"), errors); add_to_summary_table (list, line); } @@ -860,14 +870,16 @@ to ensure proper recording."), new_date_str, last_split_date_str); check_page (line, debit, credit, info->txn_type->capgains_value, gas_account (info->capgains_account), info->capgains_memo_edit, info->capgains_value, info->currency, - NC_ ("Stock Assistant: Page name", "capital gains"), errors); +// Translators: Designates a page in the stock assistant or inserts the value +// into the capital gain/loss income split of an investment transaction. + N_ ("Capital Gain"), errors); add_to_summary_table (list, line); check_page (line, debit, credit, info->txn_type->capgains_value ^ (FieldMask::ENABLED_CREDIT | FieldMask::ENABLED_DEBIT), info->acct, info->capgains_memo_edit, info->capgains_value, info->currency, - NC_ ("Stock Assistant: Page name", "capital gains"), errors); + N_ ("Capital Gain"), errors); add_to_summary_table (list, line); } @@ -1023,8 +1035,10 @@ create_split (Transaction *trans, const gchar *action, Account *account, gnc_num_dbg_to_string (amount_numeric), gnc_num_dbg_to_string (xaccSplitGetValue (split)), gnc_num_dbg_to_string (xaccSplitGetAmount (split))); - gnc_set_num_action (nullptr, split, - nullptr, g_dpgettext2 (nullptr, "Stock Assistant: Action field", action)); + auto action_str{ g_strcmp0(action, "Cash") ? + _(action) : + g_dpgettext2 (nullptr, "Stock Assistant: Action field", action)}; + gnc_set_num_action (nullptr, split, nullptr, action_str); } static void @@ -1093,7 +1107,9 @@ stock_assistant_finish (GtkAssistant *assistant, gpointer user_data) stock_value = gnc_numeric_neg (stock_value); } - create_split (trans, NC_ ("Stock Assistant: Action field", "Stock"), +// Translators: Inserts the value into action field of the non-currency asset split of +// an investment transaction. + create_split (trans, N_ ("Stock"), info->acct, account_commits, info->stock_memo_edit, stock_amount, stock_value); @@ -1103,7 +1119,7 @@ stock_assistant_finish (GtkAssistant *assistant, gpointer user_data) if (info->txn_type->cash_value & FieldMask::ENABLED_CREDIT) cash = gnc_numeric_neg (cash); - create_split (trans, NC_ ("Stock Assistant: Action field", "Cash"), + create_split (trans, NC_ ("Stock Assistant:", "Cash"), gas_account (info->cash_account), account_commits, info->cash_memo_edit, cash, cash); } @@ -1116,7 +1132,7 @@ stock_assistant_finish (GtkAssistant *assistant, gpointer user_data) auto capitalize = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->capitalize_fees_checkbox)); - create_split (trans, NC_ ("Stock Assistant: Action field", "Fees"), + create_split (trans, N_ ("Fees"), capitalize ? info->acct : gas_account (info->fees_account), account_commits, info->fees_memo_edit, capitalize ? gnc_numeric_zero () : fees, fees); @@ -1129,7 +1145,7 @@ stock_assistant_finish (GtkAssistant *assistant, gpointer user_data) if (info->txn_type->dividend_value & FieldMask::ENABLED_CREDIT) dividend = gnc_numeric_neg (dividend); - create_split (trans, NC_ ("Stock Assistant: Action field", "Dividend"), + create_split (trans, N_ ("Dividend"), gas_account (info->dividend_account), account_commits, info->dividend_memo_edit, dividend, dividend); } @@ -1137,12 +1153,12 @@ stock_assistant_finish (GtkAssistant *assistant, gpointer user_data) if (info->txn_type->capgains_value != FieldMask::DISABLED) { auto capgains = gae_amount (info->capgains_value); - create_split (trans, NC_ ("Stock Assistant: Action field", "Capital Gain"), + create_split (trans, N_ ("Capital Gain"), info->acct, account_commits, info->capgains_memo_edit, gnc_numeric_zero (), capgains); capgains = gnc_numeric_neg (capgains); - create_split (trans, NC_ ("Stock Assistant: Action field", "Capital Gain"), + create_split (trans, N_ ("Capital Gain"), gas_account (info->capgains_account), account_commits, info->capgains_memo_edit, capgains, capgains); } diff --git a/po/POTFILES.ignore b/po/POTFILES.ignore index 7ffc6081d18..1fc4c90d492 100644 --- a/po/POTFILES.ignore +++ b/po/POTFILES.ignore @@ -1,4 +1,2 @@ # These are files that we don't want to translate, because they are # in experimental status. -gnucash/gnome/assistant-stock-transaction.cpp -gnucash/gtkbuilder/assistant-stock-transaction.glade diff --git a/po/POTFILES.in b/po/POTFILES.in index 51de233dab6..cd118b76a37 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -52,6 +52,7 @@ gnucash/gnome/assistant-acct-period.c gnucash/gnome/assistant-hierarchy.c gnucash/gnome/assistant-loan.cpp gnucash/gnome/assistant-stock-split.c +gnucash/gnome/assistant-stock-transaction.cpp gnucash/gnome/business-gnome-utils.c gnucash/gnome/business-options-gnome.c gnucash/gnome/business-urls.c @@ -243,6 +244,7 @@ gnucash/gtkbuilder/assistant-hierarchy.glade gnucash/gtkbuilder/assistant-loan.glade gnucash/gtkbuilder/assistant-qif-import.glade gnucash/gtkbuilder/assistant-stock-split.glade +gnucash/gtkbuilder/assistant-stock-transaction.glade gnucash/gtkbuilder/assistant-xml-encoding.glade gnucash/gtkbuilder/business-options-gnome.glade gnucash/gtkbuilder/business-prefs.glade