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.
This commit is contained in:
Geert Janssens 2020-05-30 10:19:48 +02:00
parent 18adb5723c
commit ad826e0f44
3 changed files with 18 additions and 17 deletions

View File

@ -96,19 +96,19 @@ Gnucash::GnucashCli::configure_program_options (void)
bpo::options_description quotes_options(_("Price Quotes Retrieval Options")); bpo::options_description quotes_options(_("Price Quotes Retrieval Options"));
quotes_options.add_options() quotes_options.add_options()
("add-price-quotes", bpo::bool_switch(), ("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>(), ("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); m_opt_desc->add (quotes_options);
bpo::options_description report_options(_("Report Generation Options")); bpo::options_description report_options(_("Report Generation Options"));
report_options.add_options() report_options.add_options()
("run-report", bpo::value<std::string>(), ("run-report", bpo::value<std::string>(),
N_("Runs a report\n")) _("Runs a report\n"))
("export-type", bpo::value<std::string>(), ("export-type", bpo::value<std::string>(),
N_("Specify export type\n")) _("Specify export type\n"))
("output-file", bpo::value<std::string>(), ("output-file", bpo::value<std::string>(),
N_("Output file for report\n")); _("Output file for report\n"));
m_opt_desc->add (report_options); m_opt_desc->add (report_options);
} }

View File

@ -561,7 +561,8 @@ Gnucash::CoreApp::CoreApp (const char* app_name)
// Now that gettext is properly initialized, set our help tagline. // 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()); 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(); add_common_program_options();
} }
@ -636,21 +637,21 @@ Gnucash::CoreApp::add_common_program_options (void)
bpo::options_description common_options(_("Common Options")); bpo::options_description common_options(_("Common Options"));
common_options.add_options() common_options.add_options()
("help,h", bpo::bool_switch(), ("help,h", bpo::bool_switch(),
N_("Show this help message")) _("Show this help message"))
("version,v", bpo::bool_switch(), ("version,v", bpo::bool_switch(),
N_("Show GnuCash version")) _("Show GnuCash version"))
("debug", bpo::bool_switch(), ("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(), ("extra", bpo::bool_switch(),
N_("Enable extra/development/debugging features.")) _("Enable extra/development/debugging features."))
("log", bpo::value< std::vector<std::string> >(), ("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>(), ("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>(), ("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>(), ("input-file", bpo::value<std::string>(),
N_("[datafile]")); _("[datafile]"));
m_pos_opt_desc.add("input-file", -1); m_pos_opt_desc.add("input-file", -1);

View File

@ -333,11 +333,11 @@ Gnucash::Gnucash::configure_program_options (void)
bpo::options_description depr_options(_("Deprecated Options")); bpo::options_description depr_options(_("Deprecated Options"));
depr_options.add_options() depr_options.add_options()
("add-price-quotes", bpo::bool_switch(), ("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" "Note this option has been deprecated and will be removed in GnuCash 5.0.\n"
"Please use \"gnucash-cli --add-price-quotes\" instead.")) "Please use \"gnucash-cli --add-price-quotes\" instead."))
("namespace", bpo::value<std::string>(), ("namespace", bpo::value<std::string>(),
N_("Regular expression determining which namespace commodities will be retrieved" _("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" "Note this option has been deprecated and will be removed in GnuCash 5.0.\n"
"Please use \"gnucash-cli --add-price-quotes\" instead.")); "Please use \"gnucash-cli --add-price-quotes\" instead."));