gnucash maint: Restrict gnucash.pot comment collection to ones beginning with Translators.

John Ralls jralls at code.gnucash.org
Sat Jan 4 18:59:59 EST 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/df92200c (commit)
	from  https://github.com/Gnucash/gnucash/commit/c9998a8a (commit)



commit df92200c8ebb45ab03e363aa3892a3f5d12ed475
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Dec 31 08:40:46 2019 -0800

    Restrict gnucash.pot comment collection to ones beginning with Translators.
    
    On recommendation of the Translation Project's Benno Schulenberg.
    
    Required re-annotating some comments. Also removed several comments
    about leaving a line break to prevent inserting it into gnucash.pot.
    That didn't actually work: they were inserted anyway.

diff --git a/gnucash/gnome-search/dialog-search.c b/gnucash/gnome-search/dialog-search.c
index 5d6400a18..20cae3b21 100644
--- a/gnucash/gnome-search/dialog-search.c
+++ b/gnucash/gnome-search/dialog-search.c
@@ -1470,7 +1470,6 @@ gnc_search_dialog_test (void)
         display = get_display_list (GNC_ID_SPLIT);
 
 /* FIXME: All this does is leak. */
-/*      (keep the line break below to avoid a translator comment) */
     gnc_search_dialog_create (NULL, GNC_ID_SPLIT,
                   _("Find Transaction"),
                   params, display,
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 9f50b16ec..af60b32a7 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -3840,7 +3840,7 @@ gnc_plugin_page_register_cmd_view_sort_by (GtkAction *action,
     priv->sd.dialog = dialog;
     gtk_window_set_transient_for(GTK_WINDOW(dialog),
                                  gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window)));
-    /* Translations: The %s is the name of the plugin page */
+    /* Translators: The %s is the name of the plugin page */
     title = g_strdup_printf(_("Sort %s by..."),
                             gnc_plugin_page_get_page_name(GNC_PLUGIN_PAGE(page)));
     gtk_window_set_title(GTK_WINDOW(dialog), title);
diff --git a/gnucash/gnome/gnucash.desktop.in.in b/gnucash/gnome/gnucash.desktop.in.in
index 654479303..9b251188d 100644
--- a/gnucash/gnome/gnucash.desktop.in.in
+++ b/gnucash/gnome/gnucash.desktop.in.in
@@ -6,7 +6,7 @@ Name=GnuCash
 GenericName=Finance Management
 Comment=Manage your finances, accounts, and investments
 Exec=gnucash %f
-# Icon file name, do not translate unless you also provide a localized icon file. Alternatively use the English "gnucash-icon" as msgstr
+# Translators: Icon file name, do not translate unless you also provide a localized icon file. Alternatively use the English "gnucash-icon" as msgstr
 Icon=gnucash-icon
 StartupNotify=true
 Terminal=false
diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index b42c497d7..34320bc8f 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -746,8 +746,7 @@ gnc_gen_trans_init_view (GNCImportMainMatcher *info,
     /* prevent the rows being dragged to a different order */
     gtk_tree_view_set_reorderable (view, FALSE);
 
-    /* Add the columns *
-     * (keep the line break below to avoid a translator comment) */
+    /* Add the columns */
     add_text_column (view, _("Date"), DOWNLOADED_COL_DATE_TXT);
     info->account_column = add_text_column (view, _("Account"), DOWNLOADED_COL_ACCOUNT);
     gtk_tree_view_column_set_visible (info->account_column, show_account);
diff --git a/gnucash/import-export/log-replay/gnc-log-replay.c b/gnucash/import-export/log-replay/gnc-log-replay.c
index d6b5c7e27..9b0b93715 100644
--- a/gnucash/import-export/log-replay/gnc-log-replay.c
+++ b/gnucash/import-export/log-replay/gnc-log-replay.c
@@ -608,11 +608,10 @@ void gnc_file_log_replay (GtkWindow *parent)
             {
                 int err = errno;
                 perror("File open failed");
+                /* Translatiors: First argument is the filename,
+                 * second argument is the error.
+                 */
                 gnc_error_dialog(NULL,
-                                 /* Translation note:
-                                  * First argument is the filename,
-                                  * second argument is the error.
-                                  */
                                  _("Failed to open log file: %s: %s"),
                                  selected_filename,
                                  strerror(err));
diff --git a/gnucash/import-export/ofx/gnc-ofx-import.c b/gnucash/import-export/ofx/gnc-ofx-import.c
index 37b47d803..255fbe87f 100644
--- a/gnucash/import-export/ofx/gnc-ofx-import.c
+++ b/gnucash/import-export/ofx/gnc-ofx-import.c
@@ -624,10 +624,10 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void *user_data)
             {
                 // As we now have the commodity, select the account with that commodity.
 
-                investment_account_text = g_strdup_printf( /* This string is a default account
-                                                              name. It MUST NOT contain the
-                                                              character ':' anywhere in it or
-                                                              in any translations.  */
+                /* Translators: This string is a default account name. It MUST
+                 * NOT contain the character ':' anywhere in it or in any
+                 * translations.  */
+                investment_account_text = g_strdup_printf(
                                          _("Stock account for security \"%s\""),
                              sanitize_string (data.security_data_ptr->secname));
 
@@ -793,10 +793,10 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void *user_data)
                     if (income_account == NULL)
                     {
                         DEBUG("Couldn't find an associated income account");
-                        investment_account_text = g_strdup_printf( /* This string is a default account
-                                                                      name. It MUST NOT contain the
-                                                                      character ':' anywhere in it or
-                                                                      in any translations.  */
+                        /* Translators: This string is a default account
+                         * name. It MUST NOT contain the character ':' anywhere
+                         * in it or in any translations.  */
+                        investment_account_text = g_strdup_printf(
                                                       _("Income account for security \"%s\""),
                                                       sanitize_string (data.security_data_ptr->secname));
                         income_account = gnc_import_select_account(
diff --git a/libgnucash/engine/Recurrence.c b/libgnucash/engine/Recurrence.c
index cf1ef2904..9b71c9c4a 100644
--- a/libgnucash/engine/Recurrence.c
+++ b/libgnucash/engine/Recurrence.c
@@ -500,7 +500,7 @@ recurrenceListToString(const GList *r)
         {
             if (iter != r)
             {
-                /* translators: " + " is an separator in a list of string-representations of recurrence frequencies */
+                /* Translators: " + " is an separator in a list of string-representations of recurrence frequencies */
                 g_string_append(str, _(" + "));
             }
             s = recurrenceToString((Recurrence *)iter->data);
@@ -615,7 +615,7 @@ _weekly_list_to_compact_string(GList *rs, GString *buf)
     g_string_printf(buf, "%s", _("Weekly"));
     if (multiplier > 1)
     {
-        /* translators: %u is the recurrence multiplier, i.e. this
+        /* Translators: %u is the recurrence multiplier, i.e. this
         	   event should occur every %u'th week. */
         g_string_append_printf(buf, _(" (x%u)"), multiplier);
     }
@@ -649,7 +649,7 @@ _monthly_append_when(Recurrence *r, GString *buf)
 
         gnc_dow_abbrev(day_name_buf, abbrev_day_name_bufsize, g_date_get_weekday(&date) % 7);
 
-        /* translators: %s is an already-localized form of the day of the week. */
+        /* Translators: %s is an already-localized form of the day of the week. */
         g_string_append_printf(buf, _("last %s"), day_name_buf);
     }
     else if (recurrenceGetPeriodType(r) == PERIOD_NTH_WEEKDAY)
@@ -662,13 +662,13 @@ _monthly_append_when(Recurrence *r, GString *buf)
         gnc_dow_abbrev(day_name_buf, abbrev_day_name_bufsize, g_date_get_weekday(&date) % 7);
         day_of_month_index = g_date_get_day(&date) - 1;
         week = day_of_month_index / 7 > 3 ? 3 : day_of_month_index / 7;
-        /* translators: %s is the string 1st, 2nd, 3rd and so on, and
+        /* Translators: %s is the string 1st, 2nd, 3rd and so on, and
          * %s is an already-localized form of the day of the week. */
         g_string_append_printf(buf, _("%s %s"), _(numerals[week]), day_name_buf);
     }
     else
     {
-        /* translators: %u is the day of month */
+        /* Translators: %u is the day of month */
         g_string_append_printf(buf, "%u", g_date_get_day(&date));
     }
 }
@@ -705,7 +705,7 @@ recurrenceListToCompactString(GList *rs)
             g_string_append_printf(buf, " ");
             if (recurrenceGetMultiplier(first) > 1)
             {
-                /* translators: %u is the recurrence multiplier number */
+                /* Translators: %u is the recurrence multiplier number */
                 g_string_append_printf(buf, _(" (x%u)"), recurrenceGetMultiplier(first));
             }
             g_string_append_printf(buf, ": ");
@@ -715,7 +715,7 @@ recurrenceListToCompactString(GList *rs)
         }
         else
         {
-            /* translators: %d is the number of Recurrences in the list. */
+            /* Translators: %d is the number of Recurrences in the list. */
             g_string_printf(buf, _("Unknown, %d-size list."), g_list_length(rs));
         }
     }
@@ -736,7 +736,7 @@ recurrenceListToCompactString(GList *rs)
             g_string_printf(buf, "%s", _("Daily"));
             if (multiplier > 1)
             {
-                /* translators: %u is the recurrence multiplier. */
+                /* Translators: %u is the recurrence multiplier. */
                 g_string_append_printf(buf, _(" (x%u)"), multiplier);
             }
         }
@@ -753,7 +753,7 @@ recurrenceListToCompactString(GList *rs)
             g_string_printf(buf, "%s", _("Monthly"));
             if (multiplier > 1)
             {
-                /* translators: %u is the recurrence multiplier. */
+                /* Translators: %u is the recurrence multiplier. */
                 g_string_append_printf(buf, _(" (x%u)"), multiplier);
             }
             g_string_append_printf(buf, ": ");
@@ -764,12 +764,10 @@ recurrenceListToCompactString(GList *rs)
         {
             //g_warning("nth weekday not handled");
             //g_string_printf(buf, "@fixme: nth weekday not handled");
-        	/* (keep the line break below to avoid a translator comment) */
-            g_string_printf(buf,
-            		"%s", _("Monthly"));
+            g_string_printf(buf, "%s", _("Monthly"));
             if (multiplier > 1)
             {
-                /* translators: %u is the recurrence multiplier. */
+                /* Translators: %u is the recurrence multiplier. */
                 g_string_append_printf(buf, _(" (x%u)"), multiplier);
             }
             g_string_append_printf(buf, ": ");
@@ -781,7 +779,7 @@ recurrenceListToCompactString(GList *rs)
             g_string_printf(buf, "%s", _("Yearly"));
             if (multiplier > 1)
             {
-                /* translators: %u is the recurrence multiplier. */
+                /* Translators: %u is the recurrence multiplier. */
                 g_string_append_printf(buf, _(" (x%u)"), multiplier);
             }
         }
diff --git a/po/gnucash-pot.cmake b/po/gnucash-pot.cmake
index 426b4fc0e..be104b29f 100644
--- a/po/gnucash-pot.cmake
+++ b/po/gnucash-pot.cmake
@@ -1,5 +1,5 @@
 execute_process(
-    COMMAND ${XGETTEXT} --add-comments
+    COMMAND ${XGETTEXT} --add-comments=Translators
                         --directory=${TOP_SRC_DIR}
                         --default-domain=${PACKAGE}
                         --output=${PACKAGE}.pot



Summary of changes:
 gnucash/gnome-search/dialog-search.c              |  1 -
 gnucash/gnome/gnc-plugin-page-register.c          |  2 +-
 gnucash/gnome/gnucash.desktop.in.in               |  2 +-
 gnucash/import-export/import-main-matcher.c       |  3 +--
 gnucash/import-export/log-replay/gnc-log-replay.c |  7 +++---
 gnucash/import-export/ofx/gnc-ofx-import.c        | 16 +++++++-------
 libgnucash/engine/Recurrence.c                    | 26 +++++++++++------------
 po/gnucash-pot.cmake                              |  2 +-
 8 files changed, 27 insertions(+), 32 deletions(-)



More information about the gnucash-changes mailing list