Bug 797850 - Account register credit/debit column headings untranslated

Plus make the former globals static.
This commit is contained in:
John Ralls 2020-07-07 12:30:09 -07:00
parent 1935cdc681
commit 0e0c27f80f

View File

@ -133,44 +133,44 @@ enum
((AccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_ACCOUNT)) ((AccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_ACCOUNT))
/* This map contains a set of strings representing the different column types. */ /* This map contains a set of strings representing the different column types. */
std::map<GNCAccountType, const char*> gnc_acct_debit_strs = { static const std::map<GNCAccountType, const char*> gnc_acct_debit_strs = {
{ ACCT_TYPE_NONE, _("Funds In") }, { ACCT_TYPE_NONE, N_("Funds In") },
{ ACCT_TYPE_BANK, _("Deposit") }, { ACCT_TYPE_BANK, N_("Deposit") },
{ ACCT_TYPE_CASH, _("Receive") }, { ACCT_TYPE_CASH, N_("Receive") },
{ ACCT_TYPE_CREDIT, _("Payment") }, { ACCT_TYPE_CREDIT, N_("Payment") },
{ ACCT_TYPE_ASSET, _("Increase") }, { ACCT_TYPE_ASSET, N_("Increase") },
{ ACCT_TYPE_LIABILITY, _("Decrease") }, { ACCT_TYPE_LIABILITY, N_("Decrease") },
{ ACCT_TYPE_STOCK, _("Buy") }, { ACCT_TYPE_STOCK, N_("Buy") },
{ ACCT_TYPE_MUTUAL, _("Buy") }, { ACCT_TYPE_MUTUAL, N_("Buy") },
{ ACCT_TYPE_CURRENCY, _("Buy") }, { ACCT_TYPE_CURRENCY, N_("Buy") },
{ ACCT_TYPE_INCOME, _("Charge") }, { ACCT_TYPE_INCOME, N_("Charge") },
{ ACCT_TYPE_EXPENSE, _("Expense") }, { ACCT_TYPE_EXPENSE, N_("Expense") },
{ ACCT_TYPE_PAYABLE, _("Payment") }, { ACCT_TYPE_PAYABLE, N_("Payment") },
{ ACCT_TYPE_RECEIVABLE, _("Invoice") }, { ACCT_TYPE_RECEIVABLE, N_("Invoice") },
{ ACCT_TYPE_TRADING, _("Decrease") }, { ACCT_TYPE_TRADING, N_("Decrease") },
{ ACCT_TYPE_EQUITY, _("Decrease") }, { ACCT_TYPE_EQUITY, N_("Decrease") },
}; };
const char* dflt_acct_debit_str = _("Debit"); static const char* dflt_acct_debit_str = N_("Debit");
/* This map contains a set of strings representing the different column types. */ /* This map contains a set of strings representing the different column types. */
std::map<GNCAccountType, const char*> gnc_acct_credit_strs = { static const std::map<GNCAccountType, const char*> gnc_acct_credit_strs = {
{ ACCT_TYPE_NONE, _("Funds Out") }, { ACCT_TYPE_NONE, N_("Funds Out") },
{ ACCT_TYPE_BANK, _("Withdrawal") }, { ACCT_TYPE_BANK, N_("Withdrawal") },
{ ACCT_TYPE_CASH, _("Spend") }, { ACCT_TYPE_CASH, N_("Spend") },
{ ACCT_TYPE_CREDIT, _("Charge") }, { ACCT_TYPE_CREDIT, N_("Charge") },
{ ACCT_TYPE_ASSET, _("Decrease") }, { ACCT_TYPE_ASSET, N_("Decrease") },
{ ACCT_TYPE_LIABILITY, _("Increase") }, { ACCT_TYPE_LIABILITY, N_("Increase") },
{ ACCT_TYPE_STOCK, _("Sell") }, { ACCT_TYPE_STOCK, N_("Sell") },
{ ACCT_TYPE_MUTUAL, _("Sell") }, { ACCT_TYPE_MUTUAL, N_("Sell") },
{ ACCT_TYPE_CURRENCY, _("Sell") }, { ACCT_TYPE_CURRENCY, N_("Sell") },
{ ACCT_TYPE_INCOME, _("Income") }, { ACCT_TYPE_INCOME, N_("Income") },
{ ACCT_TYPE_EXPENSE, _("Rebate") }, { ACCT_TYPE_EXPENSE, N_("Rebate") },
{ ACCT_TYPE_PAYABLE, _("Bill") }, { ACCT_TYPE_PAYABLE, N_("Bill") },
{ ACCT_TYPE_RECEIVABLE, _("Payment") }, { ACCT_TYPE_RECEIVABLE, N_("Payment") },
{ ACCT_TYPE_TRADING, _("Increase") }, { ACCT_TYPE_TRADING, N_("Increase") },
{ ACCT_TYPE_EQUITY, _("Increase") }, { ACCT_TYPE_EQUITY, N_("Increase") },
}; };
const char* dflt_acct_credit_str = _("Credit"); static const char* dflt_acct_credit_str = N_("Credit");
/********************************************************************\ /********************************************************************\
* Because I can't use C++ for this project, doesn't mean that I * * Because I can't use C++ for this project, doesn't mean that I *
@ -4039,9 +4039,9 @@ const char *gnc_account_get_debit_string (GNCAccountType acct_type)
auto result = gnc_acct_debit_strs.find(acct_type); auto result = gnc_acct_debit_strs.find(acct_type);
if (result != gnc_acct_debit_strs.end()) if (result != gnc_acct_debit_strs.end())
return result->second; return _(result->second);
else else
return dflt_acct_debit_str; return _(dflt_acct_debit_str);
} }
const char *gnc_account_get_credit_string (GNCAccountType acct_type) const char *gnc_account_get_credit_string (GNCAccountType acct_type)
@ -4051,9 +4051,9 @@ const char *gnc_account_get_credit_string (GNCAccountType acct_type)
auto result = gnc_acct_credit_strs.find(acct_type); auto result = gnc_acct_credit_strs.find(acct_type);
if (result != gnc_acct_credit_strs.end()) if (result != gnc_acct_credit_strs.end())
return result->second; return _(result->second);
else else
return dflt_acct_credit_str; return _(dflt_acct_credit_str);
} }
/********************************************************************\ /********************************************************************\