aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-05-08 12:17:47 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-05-08 12:17:55 -0400
commit5b24f6084ede92d0f493ff416b4726245140b2c1 (patch)
tree64f8f9a29912e0f4a4466daa65403c37945b538a /src/wallet
parent3930014abcdd8f28a213e119605f68508aae1816 (diff)
parent18bd83b1fee2eb47ed4ad05c91f2d6cc311fc9ad (diff)
downloadbitcoin-5b24f6084ede92d0f493ff416b4726245140b2c1.tar.xz
Merge #16224: gui: Bilingual GUI error messages
18bd83b1fee2eb47ed4ad05c91f2d6cc311fc9ad util: Cleanup translation.h (Hennadii Stepanov) e95e658b8ec6e02229691a1941d688e96d4df6af doc: Do not translate technical or extremely rare errors (Hennadii Stepanov) 7e923d47ba9891856b86bc9f718cf2f1f773bdf6 Make InitError bilingual (Hennadii Stepanov) 917ca93553917251e0fd59717a347c63cdfd8a14 Make ThreadSafe{MessageBox|Question} bilingual (Hennadii Stepanov) 23b9fa2e5ec0425980301d2eebad81e660a5ea39 gui: Add detailed text to BitcoinGUI::message (Hennadii Stepanov) Pull request description: This is an alternative to #15340 (it works with the `Chain` interface; see: https://github.com/bitcoin/bitcoin/pull/15340#issuecomment-502674004). Refs: - #16218 (partial fix) - https://github.com/bitcoin/bitcoin/pull/15894#issuecomment-487947077 This PR: - makes GUI error messages bilingual: user's native language + untranslated (i.e. English) - insures that only untranslated messages are written to the debug log file and to `stderr` (that is not the case on master). If a translated string is unavailable only an English string appears to a user. Here are some **examples** (updated): ![Screenshot from 2020-04-24 17-08-37](https://user-images.githubusercontent.com/32963518/80222043-e2458780-864e-11ea-83fc-197b7121dba5.png) ![Screenshot from 2020-04-24 17-12-17](https://user-images.githubusercontent.com/32963518/80222051-e5407800-864e-11ea-92f7-dfef1144becd.png) * `qt5ct: using qt5ct plugin` message is my local environment specific; please ignore it. --- Note for reviewers: `InitWarning()` is out of this PR scope. ACKs for top commit: Sjors: re-tACK 18bd83b1fee2eb47ed4ad05c91f2d6cc311fc9ad MarcoFalke: ACK 18bd83b1fee2eb47ed4ad05c91f2d6cc311fc9ad 🐦 Tree-SHA512: 3cc8ec44f84403e54b57d11714c86b0855ed90eb794b5472e432005073354b9e3f7b4e8e7bf347a4c21be47299dbc7170f2d0c4b80e308205ff09596e55a4f96
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/init.cpp6
-rw-r--r--src/wallet/load.cpp14
2 files changed, 10 insertions, 10 deletions
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp
index 8688f3df5e..6f973aab1c 100644
--- a/src/wallet/init.cpp
+++ b/src/wallet/init.cpp
@@ -91,7 +91,7 @@ bool WalletInit::ParameterInteraction() const
if (gArgs.GetBoolArg("-salvagewallet", false)) {
if (is_multiwallet) {
- return InitError(strprintf("%s is only allowed with a single wallet file", "-salvagewallet"));
+ return InitError(strprintf(Untranslated("%s is only allowed with a single wallet file"), "-salvagewallet"));
}
// Rewrite just private keys: rescan to find transactions
if (gArgs.SoftSetBoolArg("-rescan", true)) {
@@ -108,7 +108,7 @@ bool WalletInit::ParameterInteraction() const
// -zapwallettxes implies a rescan
if (zapwallettxes) {
if (is_multiwallet) {
- return InitError(strprintf("%s is only allowed with a single wallet file", "-zapwallettxes"));
+ return InitError(strprintf(Untranslated("%s is only allowed with a single wallet file"), "-zapwallettxes"));
}
if (gArgs.SoftSetBoolArg("-rescan", true)) {
LogPrintf("%s: parameter interaction: -zapwallettxes enabled -> setting -rescan=1\n", __func__);
@@ -116,7 +116,7 @@ bool WalletInit::ParameterInteraction() const
}
if (gArgs.GetBoolArg("-sysperms", false))
- return InitError("-sysperms is not allowed in combination with enabled wallet functionality");
+ return InitError(Untranslated("-sysperms is not allowed in combination with enabled wallet functionality"));
return true;
}
diff --git a/src/wallet/load.cpp b/src/wallet/load.cpp
index 217a950457..45841b2ae1 100644
--- a/src/wallet/load.cpp
+++ b/src/wallet/load.cpp
@@ -20,14 +20,14 @@ bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wal
// The canonical path cleans the path, preventing >1 Berkeley environment instances for the same directory
fs::path canonical_wallet_dir = fs::canonical(wallet_dir, error);
if (error || !fs::exists(wallet_dir)) {
- chain.initError(strprintf(_("Specified -walletdir \"%s\" does not exist").translated, wallet_dir.string()));
+ chain.initError(strprintf(_("Specified -walletdir \"%s\" does not exist"), wallet_dir.string()));
return false;
} else if (!fs::is_directory(wallet_dir)) {
- chain.initError(strprintf(_("Specified -walletdir \"%s\" is not a directory").translated, wallet_dir.string()));
+ chain.initError(strprintf(_("Specified -walletdir \"%s\" is not a directory"), wallet_dir.string()));
return false;
// The canonical path transforms relative paths into absolute ones, so we check the non-canonical version
} else if (!wallet_dir.is_absolute()) {
- chain.initError(strprintf(_("Specified -walletdir \"%s\" is a relative path").translated, wallet_dir.string()));
+ chain.initError(strprintf(_("Specified -walletdir \"%s\" is a relative path"), wallet_dir.string()));
return false;
}
gArgs.ForceSetArg("-walletdir", canonical_wallet_dir.string());
@@ -49,7 +49,7 @@ bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wal
WalletLocation location(wallet_file);
if (!wallet_paths.insert(location.GetPath()).second) {
- chain.initError(strprintf(_("Error loading wallet %s. Duplicate -wallet filename specified.").translated, wallet_file));
+ chain.initError(strprintf(_("Error loading wallet %s. Duplicate -wallet filename specified."), wallet_file));
return false;
}
@@ -58,7 +58,7 @@ bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wal
bool verify_success = CWallet::Verify(chain, location, salvage_wallet, error_string, warnings);
if (!warnings.empty()) chain.initWarning(Join(warnings, "\n", OpTranslated));
if (!verify_success) {
- chain.initError(error_string.translated);
+ chain.initError(error_string);
return false;
}
}
@@ -75,14 +75,14 @@ bool LoadWallets(interfaces::Chain& chain, const std::vector<std::string>& walle
std::shared_ptr<CWallet> pwallet = CWallet::CreateWalletFromFile(chain, WalletLocation(walletFile), error, warnings);
if (!warnings.empty()) chain.initWarning(Join(warnings, "\n", OpTranslated));
if (!pwallet) {
- chain.initError(error.translated);
+ chain.initError(error);
return false;
}
AddWallet(pwallet);
}
return true;
} catch (const std::runtime_error& e) {
- chain.initError(e.what());
+ chain.initError(Untranslated(e.what()));
return false;
}
}