diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -1896,8 +1896,9 @@ Amount n = Amount::zero(); auto parsed = ParseMoney(gArgs.GetArg("-excessutxocharge", ""), n); if (!parsed || Amount::zero() > n) { - return InitError(AmountErrMsg( - "excessutxocharge", gArgs.GetArg("-excessutxocharge", ""))); + return InitError(AmountErrMsg("excessutxocharge", + gArgs.GetArg("-excessutxocharge", "")) + .translated); } config.SetExcessUTXOCharge(n); } else { @@ -1909,7 +1910,8 @@ auto parsed = ParseMoney(gArgs.GetArg("-minrelaytxfee", ""), n); if (!parsed || n == Amount::zero()) { return InitError(AmountErrMsg("minrelaytxfee", - gArgs.GetArg("-minrelaytxfee", ""))); + gArgs.GetArg("-minrelaytxfee", "")) + .translated); } // High fee check is done afterward in WalletParameterInteraction() ::minRelayTxFee = CFeeRate(n); @@ -1922,7 +1924,8 @@ Amount n = Amount::zero(); if (!ParseMoney(gArgs.GetArg("-blockmintxfee", ""), n)) { return InitError(AmountErrMsg("blockmintxfee", - gArgs.GetArg("-blockmintxfee", ""))); + gArgs.GetArg("-blockmintxfee", "")) + .translated); } } @@ -1932,8 +1935,9 @@ Amount n = Amount::zero(); auto parsed = ParseMoney(gArgs.GetArg("-dustrelayfee", ""), n); if (!parsed || Amount::zero() == n) { - return InitError(AmountErrMsg("dustrelayfee", - gArgs.GetArg("-dustrelayfee", ""))); + return InitError( + AmountErrMsg("dustrelayfee", gArgs.GetArg("-dustrelayfee", "")) + .translated); } dustRelayFee = CFeeRate(n); } diff --git a/src/util/error.h b/src/util/error.h --- a/src/util/error.h +++ b/src/util/error.h @@ -17,6 +17,8 @@ #include +struct bilingual_str; + enum class TransactionError { OK, //!< No error @@ -33,9 +35,9 @@ std::string TransactionErrorString(TransactionError error); -std::string AmountHighWarn(const std::string &optname); +bilingual_str AmountHighWarn(const std::string &optname); -std::string AmountErrMsg(const std::string &optname, - const std::string &strValue); +bilingual_str AmountErrMsg(const std::string &optname, + const std::string &strValue); #endif // BITCOIN_UTIL_ERROR_H diff --git a/src/util/error.cpp b/src/util/error.cpp --- a/src/util/error.cpp +++ b/src/util/error.cpp @@ -35,12 +35,12 @@ assert(false); } -std::string AmountHighWarn(const std::string &optname) { - return strprintf(_("%s is set very high!").translated, optname); +bilingual_str AmountHighWarn(const std::string &optname) { + return strprintf(_("%s is set very high!"), optname); } -std::string AmountErrMsg(const std::string &optname, - const std::string &strValue) { - return strprintf(_("Invalid amount for -%s=: '%s'").translated, - optname, strValue); +bilingual_str AmountErrMsg(const std::string &optname, + const std::string &strValue) { + return strprintf(_("Invalid amount for -%s=: '%s'"), optname, + strValue); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4884,12 +4884,13 @@ if (!ParseMoney(gArgs.GetArg("-mintxfee", ""), n) || n == Amount::zero()) { chain.initError( - AmountErrMsg("mintxfee", gArgs.GetArg("-mintxfee", ""))); + AmountErrMsg("mintxfee", gArgs.GetArg("-mintxfee", "")) + .translated); return nullptr; } if (n > HIGH_TX_FEE_PER_KB) { chain.initWarning( - AmountHighWarn("-mintxfee") + " " + + AmountHighWarn("-mintxfee").translated + " " + _("This is the minimum transaction fee you pay on " "every transaction.") .translated); @@ -4907,7 +4908,7 @@ } if (nFeePerK > HIGH_TX_FEE_PER_KB) { chain.initWarning( - AmountHighWarn("-fallbackfee") + " " + + AmountHighWarn("-fallbackfee").translated + " " + _("This is the transaction fee you may pay when fee " "estimates are not available.") .translated); @@ -4921,12 +4922,13 @@ Amount nFeePerK = Amount::zero(); if (!ParseMoney(gArgs.GetArg("-paytxfee", ""), nFeePerK)) { chain.initError( - AmountErrMsg("paytxfee", gArgs.GetArg("-paytxfee", ""))); + AmountErrMsg("paytxfee", gArgs.GetArg("-paytxfee", "")) + .translated); return nullptr; } if (nFeePerK > HIGH_TX_FEE_PER_KB) { chain.initWarning( - AmountHighWarn("-paytxfee") + " " + + AmountHighWarn("-paytxfee").translated + " " + _("This is the transaction fee you will pay if you " "send a transaction.") .translated); @@ -4946,7 +4948,8 @@ Amount nMaxFee = Amount::zero(); if (!ParseMoney(gArgs.GetArg("-maxtxfee", ""), nMaxFee)) { chain.initError( - AmountErrMsg("maxtxfee", gArgs.GetArg("-maxtxfee", ""))); + AmountErrMsg("maxtxfee", gArgs.GetArg("-maxtxfee", "")) + .translated); return nullptr; } if (nMaxFee > HIGH_MAX_TX_FEE) { @@ -4967,7 +4970,7 @@ if (chain.relayMinFee().GetFeePerK() > HIGH_TX_FEE_PER_KB) { chain.initWarning( - AmountHighWarn("-minrelaytxfee") + " " + + AmountHighWarn("-minrelaytxfee").translated + " " + _("The wallet will avoid paying less than the minimum relay fee.") .translated); }