gnucash master: A few translation tweaks in gnucash and gnucash-cli

Geert Janssens gjanssens at code.gnucash.org
Sat May 30 04:20:03 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/ad826e0f (commit)
	from  https://github.com/Gnucash/gnucash/commit/18adb572 (commit)



commit ad826e0f4441b567955e0f101e620cc3bd361195
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat May 30 10:19:48 2020 +0200

    A few translation tweaks in gnucash and gnucash-cli
    
    Contrary to glib's option parsing, boost's doesn't do further translations
    internally, so pass it pre-translated messages.

diff --git a/gnucash/gnucash-cli.cpp b/gnucash/gnucash-cli.cpp
index 153cb2d19..9d70bc82c 100644
--- a/gnucash/gnucash-cli.cpp
+++ b/gnucash/gnucash-cli.cpp
@@ -96,19 +96,19 @@ Gnucash::GnucashCli::configure_program_options (void)
     bpo::options_description quotes_options(_("Price Quotes Retrieval Options"));
     quotes_options.add_options()
     ("add-price-quotes", bpo::bool_switch(),
-     N_("Add price quotes to given GnuCash datafile.\n"))
+     _("Add price quotes to given GnuCash datafile."))
     ("namespace", bpo::value<std::string>(),
-     N_("Regular expression determining which namespace commodities will be retrieved"));
+     _("Regular expression determining which namespace commodities will be retrieved"));
     m_opt_desc->add (quotes_options);
 
     bpo::options_description report_options(_("Report Generation Options"));
     report_options.add_options()
     ("run-report", bpo::value<std::string>(),
-     N_("Runs a report\n"))
+     _("Runs a report\n"))
     ("export-type", bpo::value<std::string>(),
-     N_("Specify export type\n"))
+     _("Specify export type\n"))
     ("output-file", bpo::value<std::string>(),
-     N_("Output file for report\n"));
+     _("Output file for report\n"));
     m_opt_desc->add (report_options);
 
 }
diff --git a/gnucash/gnucash-core-app.cpp b/gnucash/gnucash-core-app.cpp
index 3017a9bb8..4d0f6919a 100644
--- a/gnucash/gnucash-core-app.cpp
+++ b/gnucash/gnucash-core-app.cpp
@@ -561,7 +561,8 @@ Gnucash::CoreApp::CoreApp (const char* app_name)
 
     // Now that gettext is properly initialized, set our help tagline.
     tagline = bl::translate("- GnuCash, accounting for personal and small business finance").str(gnc_get_locale());
-    m_opt_desc = std::make_unique<bpo::options_description> ((bl::format (bl::gettext ("{1} [options]")) % m_app_name).str() + tagline);
+    m_opt_desc = std::make_unique<bpo::options_description>
+        ((bl::format (bl::gettext ("{1} [options] [datafile]")) % m_app_name).str() + std::string(" ") + tagline);
     add_common_program_options();
 }
 
@@ -636,21 +637,21 @@ Gnucash::CoreApp::add_common_program_options (void)
     bpo::options_description common_options(_("Common Options"));
     common_options.add_options()
         ("help,h", bpo::bool_switch(),
-         N_("Show this help message"))
+         _("Show this help message"))
         ("version,v", bpo::bool_switch(),
-         N_("Show GnuCash version"))
+         _("Show GnuCash version"))
         ("debug", bpo::bool_switch(),
-         N_("Enable debugging mode: provide deep detail in the logs.\nThis is equivalent to: --log \"=info\" --log \"qof=info\" --log \"gnc=info\""))
+         _("Enable debugging mode: provide deep detail in the logs.\nThis is equivalent to: --log \"=info\" --log \"qof=info\" --log \"gnc=info\""))
         ("extra", bpo::bool_switch(),
-         N_("Enable extra/development/debugging features."))
+         _("Enable extra/development/debugging features."))
         ("log", bpo::value< std::vector<std::string> >(),
-         N_("Log level overrides, of the form \"modulename={debug,info,warn,crit,error}\"\nExamples: \"--log qof=debug\" or \"--log gnc.backend.file.sx=info\"\nThis can be invoked multiple times."))
+         _("Log level overrides, of the form \"modulename={debug,info,warn,crit,error}\"\nExamples: \"--log qof=debug\" or \"--log gnc.backend.file.sx=info\"\nThis can be invoked multiple times."))
         ("logto", bpo::value<std::string>(),
-         N_("File to log into; defaults to \"/tmp/gnucash.trace\"; can be \"stderr\" or \"stdout\"."))
+         _("File to log into; defaults to \"/tmp/gnucash.trace\"; can be \"stderr\" or \"stdout\"."))
         ("gsettings-prefix", bpo::value<std::string>(),
-         N_("Set the prefix for gsettings schemas for gsettings queries. This can be useful to have a different settings tree while debugging."))
+         _("Set the prefix for gsettings schemas for gsettings queries. This can be useful to have a different settings tree while debugging."))
         ("input-file", bpo::value<std::string>(),
-         N_("[datafile]"));
+         _("[datafile]"));
 
         m_pos_opt_desc.add("input-file", -1);
 
diff --git a/gnucash/gnucash.cpp b/gnucash/gnucash.cpp
index 4be796cbe..869dbc0d5 100644
--- a/gnucash/gnucash.cpp
+++ b/gnucash/gnucash.cpp
@@ -333,12 +333,12 @@ Gnucash::Gnucash::configure_program_options (void)
     bpo::options_description depr_options(_("Deprecated Options"));
     depr_options.add_options()
     ("add-price-quotes", bpo::bool_switch(),
-     N_("Add price quotes to given GnuCash datafile.\n"
+     _("Add price quotes to given GnuCash datafile.\n"
         "Note this option has been deprecated and will be removed in GnuCash 5.0.\n"
         "Please use \"gnucash-cli --add-price-quotes\" instead."))
     ("namespace", bpo::value<std::string>(),
-     N_("Regular expression determining which namespace commodities will be retrieved"
-        "Note this option has been deprecated and will be removed in GnuCash 5.0.\n"
+     _("Regular expression determining which namespace commodities will be retrieved.\n"
+       "Note this option has been deprecated and will be removed in GnuCash 5.0.\n"
         "Please use \"gnucash-cli --add-price-quotes\" instead."));
 
     m_opt_desc->add (app_options).add (depr_options);



Summary of changes:
 gnucash/gnucash-cli.cpp      | 10 +++++-----
 gnucash/gnucash-core-app.cpp | 19 ++++++++++---------
 gnucash/gnucash.cpp          |  6 +++---
 3 files changed, 18 insertions(+), 17 deletions(-)



More information about the gnucash-changes mailing list