mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-18 19:40:40 +01:00
Merge #16745: wallet: Translate all initErrors in CreateWalletFromFile
fa61365a13wallet: Translate all initErrors in CreateWalletFromFile (MarcoFalke)fa70d199d0util: Make util/error bilingual_str (refactor) (MarcoFalke) Pull request description: The translations are going to close in three days (#15940), so I am submitting this as a standalone pull request. Those changes are part of a bugfix #16661, which includes a test. The first change (the refactor) is required, the second commit is not. I am happy to drop it, if needed. ACKs for top commit: laanwj: utACKfa61365a13hebasto: ACKfa61365a13, I have tested the code on Linux Mint 19.2. Tree-SHA512: a7616cc38b9ffd301c6b915ea808a65815c3d97e9f57ec091772eb260e5cf0d75a13a6e4dfa3913e236833677c7929b9a748cb7d7a0e406d51749944b614e11b
This commit is contained in:
@@ -4387,23 +4387,23 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
|
||||
}
|
||||
|
||||
if (!gArgs.GetArg("-addresstype", "").empty() && !ParseOutputType(gArgs.GetArg("-addresstype", ""), walletInstance->m_default_address_type)) {
|
||||
chain.initError(strprintf("Unknown address type '%s'", gArgs.GetArg("-addresstype", "")));
|
||||
chain.initError(strprintf(_("Unknown address type '%s'").translated, gArgs.GetArg("-addresstype", "")));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!gArgs.GetArg("-changetype", "").empty() && !ParseOutputType(gArgs.GetArg("-changetype", ""), walletInstance->m_default_change_type)) {
|
||||
chain.initError(strprintf("Unknown change type '%s'", gArgs.GetArg("-changetype", "")));
|
||||
chain.initError(strprintf(_("Unknown change type '%s'").translated, gArgs.GetArg("-changetype", "")));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (gArgs.IsArgSet("-mintxfee")) {
|
||||
CAmount n = 0;
|
||||
if (!ParseMoney(gArgs.GetArg("-mintxfee", ""), n) || 0 == n) {
|
||||
chain.initError(AmountErrMsg("mintxfee", gArgs.GetArg("-mintxfee", "")));
|
||||
chain.initError(AmountErrMsg("mintxfee", gArgs.GetArg("-mintxfee", "")).translated);
|
||||
return nullptr;
|
||||
}
|
||||
if (n > HIGH_TX_FEE_PER_KB) {
|
||||
chain.initWarning(AmountHighWarn("-mintxfee") + " " +
|
||||
chain.initWarning(AmountHighWarn("-mintxfee").translated + " " +
|
||||
_("This is the minimum transaction fee you pay on every transaction.").translated);
|
||||
}
|
||||
walletInstance->m_min_fee = CFeeRate(n);
|
||||
@@ -4417,7 +4417,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
|
||||
return nullptr;
|
||||
}
|
||||
if (nFeePerK > HIGH_TX_FEE_PER_KB) {
|
||||
chain.initWarning(AmountHighWarn("-fallbackfee") + " " +
|
||||
chain.initWarning(AmountHighWarn("-fallbackfee").translated + " " +
|
||||
_("This is the transaction fee you may pay when fee estimates are not available.").translated);
|
||||
}
|
||||
walletInstance->m_fallback_fee = CFeeRate(nFeePerK);
|
||||
@@ -4430,7 +4430,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
|
||||
return nullptr;
|
||||
}
|
||||
if (nFeePerK > HIGH_TX_FEE_PER_KB) {
|
||||
chain.initWarning(AmountHighWarn("-discardfee") + " " +
|
||||
chain.initWarning(AmountHighWarn("-discardfee").translated + " " +
|
||||
_("This is the transaction fee you may discard if change is smaller than dust at this level").translated);
|
||||
}
|
||||
walletInstance->m_discard_rate = CFeeRate(nFeePerK);
|
||||
@@ -4438,11 +4438,11 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
|
||||
if (gArgs.IsArgSet("-paytxfee")) {
|
||||
CAmount nFeePerK = 0;
|
||||
if (!ParseMoney(gArgs.GetArg("-paytxfee", ""), nFeePerK)) {
|
||||
chain.initError(AmountErrMsg("paytxfee", gArgs.GetArg("-paytxfee", "")));
|
||||
chain.initError(AmountErrMsg("paytxfee", gArgs.GetArg("-paytxfee", "")).translated);
|
||||
return nullptr;
|
||||
}
|
||||
if (nFeePerK > HIGH_TX_FEE_PER_KB) {
|
||||
chain.initWarning(AmountHighWarn("-paytxfee") + " " +
|
||||
chain.initWarning(AmountHighWarn("-paytxfee").translated + " " +
|
||||
_("This is the transaction fee you will pay if you send a transaction.").translated);
|
||||
}
|
||||
walletInstance->m_pay_tx_fee = CFeeRate(nFeePerK, 1000);
|
||||
@@ -4457,7 +4457,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
|
||||
{
|
||||
CAmount nMaxFee = 0;
|
||||
if (!ParseMoney(gArgs.GetArg("-maxtxfee", ""), nMaxFee)) {
|
||||
chain.initError(AmountErrMsg("maxtxfee", gArgs.GetArg("-maxtxfee", "")));
|
||||
chain.initError(AmountErrMsg("maxtxfee", gArgs.GetArg("-maxtxfee", "")).translated);
|
||||
return nullptr;
|
||||
}
|
||||
if (nMaxFee > HIGH_MAX_TX_FEE) {
|
||||
@@ -4471,9 +4471,10 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
|
||||
walletInstance->m_default_max_tx_fee = nMaxFee;
|
||||
}
|
||||
|
||||
if (chain.relayMinFee().GetFeePerK() > HIGH_TX_FEE_PER_KB)
|
||||
chain.initWarning(AmountHighWarn("-minrelaytxfee") + " " +
|
||||
if (chain.relayMinFee().GetFeePerK() > HIGH_TX_FEE_PER_KB) {
|
||||
chain.initWarning(AmountHighWarn("-minrelaytxfee").translated + " " +
|
||||
_("The wallet will avoid paying less than the minimum relay fee.").translated);
|
||||
}
|
||||
|
||||
walletInstance->m_confirm_target = gArgs.GetArg("-txconfirmtarget", DEFAULT_TX_CONFIRM_TARGET);
|
||||
walletInstance->m_spend_zero_conf_change = gArgs.GetBoolArg("-spendzeroconfchange", DEFAULT_SPEND_ZEROCONF_CHANGE);
|
||||
|
||||
Reference in New Issue
Block a user