diff --git a/src/Makefile.am b/src/Makefile.am index f6fff1df6632c2..b2e979b4866585 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -327,7 +327,6 @@ BITCOIN_CORE_H = \ util/tokenpipe.h \ util/trace.h \ util/transaction_identifier.h \ - util/translation.h \ util/types.h \ util/ui_change_type.h \ util/vector.h \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 46b9495fc1b63b..2bb716c1f5e4bf 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -153,7 +153,6 @@ BITCOIN_TESTS =\ test/timedata_tests.cpp \ test/torcontrol_tests.cpp \ test/transaction_tests.cpp \ - test/translation_tests.cpp \ test/txindex_tests.cpp \ test/txpackage_tests.cpp \ test/txreconciliation_tests.cpp \ diff --git a/src/addrdb.cpp b/src/addrdb.cpp index 8cf932bcb63969..1e10394e450b0a 100644 --- a/src/addrdb.cpp +++ b/src/addrdb.cpp @@ -22,7 +22,6 @@ #include #include #include -#include namespace { @@ -199,14 +198,14 @@ util::Result> LoadAddrman(const NetGroupManager& netgro DumpPeerAddresses(args, *addrman); } catch (const InvalidAddrManVersionError&) { if (!RenameOver(path_addr, (fs::path)path_addr + ".bak")) { - return util::Error{strprintf(_("Failed to rename invalid peers.dat file. Please move or delete it and try again."))}; + return util::Error{strprintf("Failed to rename invalid peers.dat file. Please move or delete it and try again.")}; } // Addrman can be in an inconsistent state after failure, reset it addrman = std::make_unique(netgroupman, /*deterministic=*/false, /*consistency_check_ratio=*/check_addrman); LogPrintf("Creating new peers.dat because the file version was not compatible (%s). Original backed up to peers.dat.bak\n", fs::quoted(fs::PathToString(path_addr))); DumpPeerAddresses(args, *addrman); } catch (const std::exception& e) { - return util::Error{strprintf(_("Invalid or corrupt peers.dat (%s). If you believe this is a bug, please report it to %s. As a workaround, you can move the file (%s) out of the way (rename, move, or delete) to have a new one created on the next start."), + return util::Error{strprintf("Invalid or corrupt peers.dat (%s). If you believe this is a bug, please report it to %s. As a workaround, you can move the file (%s) out of the way (rename, move, or delete) to have a new one created on the next start.", e.what(), PACKAGE_BUGREPORT, fs::quoted(fs::PathToString(path_addr)))}; } return addrman; diff --git a/src/banman.cpp b/src/banman.cpp index 9f668d76a311bf..6c9bafb9957e4a 100644 --- a/src/banman.cpp +++ b/src/banman.cpp @@ -11,7 +11,6 @@ #include #include #include -#include BanMan::BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time) @@ -30,7 +29,7 @@ void BanMan::LoadBanlist() { LOCK(m_banned_mutex); - if (m_client_interface) m_client_interface->InitMessage(_("Loading banlist…").translated); + if (m_client_interface) m_client_interface->InitMessage("Loading banlist…"); const auto start{SteadyClock::now()}; if (m_ban_db.Read(m_banned)) { diff --git a/src/bench/wallet_create.cpp b/src/bench/wallet_create.cpp index 993c4c4b3fde85..bd9880a9f8016f 100644 --- a/src/bench/wallet_create.cpp +++ b/src/bench/wallet_create.cpp @@ -29,8 +29,8 @@ static void WalletCreate(benchmark::Bench& bench, bool encrypted) } DatabaseStatus status; - bilingual_str error_string; - std::vector warnings; + std::string error_string; + std::vector warnings; fs::path wallet_path = test_setup->m_path_root / strprintf("test_wallet_%d", random.rand32()).c_str(); bench.run([&] { diff --git a/src/bench/wallet_loading.cpp b/src/bench/wallet_loading.cpp index b17c7fe05a8a34..bf602b23b290c3 100644 --- a/src/bench/wallet_loading.cpp +++ b/src/bench/wallet_loading.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp index ee8b0a44c52c6f..b8f6c8fa87d642 100644 --- a/src/bitcoin-chainstate.cpp +++ b/src/bitcoin-chainstate.cpp @@ -91,22 +91,22 @@ int main(int argc, char* argv[]) { std::cout << "Header tip changed: " << height << ", " << timestamp << ", " << presync << std::endl; } - void progress(const bilingual_str& title, int progress_percent, bool resume_possible) override + void progress(const std::string& title, int progress_percent, bool resume_possible) override { - std::cout << "Progress: " << title.original << ", " << progress_percent << ", " << resume_possible << std::endl; + std::cout << "Progress: " << title << ", " << progress_percent << ", " << resume_possible << std::endl; } - void warning(const bilingual_str& warning) override + void warning(const std::string& warning) override { - std::cout << "Warning: " << warning.original << std::endl; + std::cout << "Warning: " << warning << std::endl; } void flushError(const std::string& debug_message) override { std::cerr << "Error flushing block data to disk: " << debug_message << std::endl; } - void fatalError(const std::string& debug_message, const bilingual_str& user_message) override + void fatalError(const std::string& debug_message, const std::string& user_message) override { std::cerr << "Error: " << debug_message << std::endl; - std::cerr << (user_message.empty() ? "A fatal internal error occurred." : user_message.original) << std::endl; + std::cerr << (user_message.empty() ? "A fatal internal error occurred." : user_message) << std::endl; } }; auto notifications = std::make_unique(); diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index f0e27cb6750dac..2c89ce33d7a0ec 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 320624c419b803..a41b00d5c4498a 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include diff --git a/src/bitcoin-util.cpp b/src/bitcoin-util.cpp index 96387e8c71e8a4..89ba99ab0f1fe2 100644 --- a/src/bitcoin-util.cpp +++ b/src/bitcoin-util.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include diff --git a/src/bitcoin-wallet.cpp b/src/bitcoin-wallet.cpp index d5dfbbec2713a7..3012b44a3388b6 100644 --- a/src/bitcoin-wallet.cpp +++ b/src/bitcoin-wallet.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 4f0a816388e7f4..32ec01d7af0518 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -112,11 +111,10 @@ int fork_daemon(bool nochdir, bool noclose, TokenPipeEnd& endpoint) static bool ParseArgs(ArgsManager& args, int argc, char* argv[]) { - // If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main() SetupServerArgs(args); std::string error; if (!args.ParseParameters(argc, argv, error)) { - return InitError(Untranslated(strprintf("Error parsing command line arguments: %s", error))); + return InitError(strprintf("Error parsing command line arguments: %s", error)); } if (auto error = common::InitConfig(args)) { @@ -126,7 +124,7 @@ static bool ParseArgs(ArgsManager& args, int argc, char* argv[]) // Error out when loose non-argument tokens are encountered on command line for (int i = 1; i < argc; i++) { if (!IsSwitchChar(argv[i][0])) { - return InitError(Untranslated(strprintf("Command line contains unexpected token '%s', see bitcoind -h for a list of options.", argv[i]))); + return InitError(strprintf("Command line contains unexpected token '%s', see bitcoind -h for a list of options.", argv[i])); } } return true; @@ -169,7 +167,6 @@ static bool AppInit(NodeContext& node) std::any context{&node}; try { - // -server defaults to true for bitcoind but not for the GUI so do this here args.SoftSetBoolArg("-server", true); // Set this early so that parameter interactions go to console InitLogging(args); @@ -204,7 +201,7 @@ static bool AppInit(NodeContext& node) } break; case -1: // Error happened. - return InitError(Untranslated(strprintf("fork_daemon() failed: %s", SysErrorString(errno)))); + return InitError(strprintf("fork_daemon() failed: %s", SysErrorString(errno))); default: { // Parent: wait and exit. int token = daemon_ep.TokenRead(); if (token) { // Success diff --git a/src/clientversion.cpp b/src/clientversion.cpp index e7d63e34c6a3bc..04b8beea5cf302 100644 --- a/src/clientversion.cpp +++ b/src/clientversion.cpp @@ -3,7 +3,6 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include -#include #include @@ -12,9 +11,7 @@ #include /** - * Name of client reported in the 'version' message. Report the same name - * for both bitcoind and bitcoin-qt, to make it harder for attackers to - * target servers or GUI users specifically. + * Name of client reported in the 'version' message. */ const std::string CLIENT_NAME("Satoshi"); @@ -79,7 +76,7 @@ std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::string CopyrightHolders(const std::string& strPrefix) { - const auto copyright_devs = strprintf(_(COPYRIGHT_HOLDERS).translated, COPYRIGHT_HOLDERS_SUBSTITUTION); + const auto copyright_devs = strprintf(COPYRIGHT_HOLDERS, COPYRIGHT_HOLDERS_SUBSTITUTION); std::string strCopyrightHolders = strPrefix + copyright_devs; // Make sure Bitcoin Core copyright is not removed by accident @@ -93,15 +90,15 @@ std::string LicenseInfo() { const std::string URL_SOURCE_CODE = ""; - return CopyrightHolders(strprintf(_("Copyright (C) %i-%i").translated, 2009, COPYRIGHT_YEAR) + " ") + "\n" + + return CopyrightHolders(strprintf("Copyright (C) %i-%i", 2009, COPYRIGHT_YEAR) + " ") + "\n" + "\n" + - strprintf(_("Please contribute if you find %s useful. " - "Visit %s for further information about the software.").translated, PACKAGE_NAME, "<" PACKAGE_URL ">") + + strprintf("Please contribute if you find %s useful. " + "Visit %s for further information about the software.", PACKAGE_NAME, "<" PACKAGE_URL ">") + "\n" + - strprintf(_("The source code is available from %s.").translated, URL_SOURCE_CODE) + + strprintf("The source code is available from %s.", URL_SOURCE_CODE) + "\n" + "\n" + - _("This is experimental software.").translated + "\n" + - strprintf(_("Distributed under the MIT software license, see the accompanying file %s or %s").translated, "COPYING", "") + + "This is experimental software." + "\n" + + strprintf("Distributed under the MIT software license, see the accompanying file %s or %s", "COPYING", "") + "\n"; } diff --git a/src/coins.h b/src/coins.h index c798cc38ba5a79..bf3933361166d8 100644 --- a/src/coins.h +++ b/src/coins.h @@ -368,7 +368,7 @@ const Coin& AccessByTxid(const CCoinsViewCache& cache, const Txid& txid); /** * This is a minimally invasive approach to shutdown on LevelDB read errors from the * chainstate, while keeping user interface out of the common library, which is shared - * between bitcoind, and bitcoin-qt and non-server tools. + * between bitcoind and non-server tools. * * Writes do not need similar protection, as failure to write is handled by the caller. */ diff --git a/src/common/init.cpp b/src/common/init.cpp index 412d73aec7016c..046a37b014bea8 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include @@ -19,7 +18,7 @@ std::optional InitConfig(ArgsManager& args, SettingsAbortFn setting { try { if (!CheckDataDirOption(args)) { - return ConfigError{ConfigStatus::FAILED, strprintf(_("Specified data directory \"%s\" does not exist."), args.GetArg("-datadir", ""))}; + return ConfigError{ConfigStatus::FAILED, strprintf("Specified data directory \"%s\" does not exist.", args.GetArg("-datadir", ""))}; } // Record original datadir and config paths before parsing the config @@ -36,7 +35,7 @@ std::optional InitConfig(ArgsManager& args, SettingsAbortFn setting std::string error; if (!args.ReadConfigFiles(error, true)) { - return ConfigError{ConfigStatus::FAILED, strprintf(_("Error reading configuration file: %s"), error)}; + return ConfigError{ConfigStatus::FAILED, strprintf("Error reading configuration file: %s", error)}; } // Check for chain settings (Params() calls are only valid after this clause) @@ -84,7 +83,7 @@ std::optional InitConfig(ArgsManager& args, SettingsAbortFn setting if (args.GetBoolArg("-allowignoredconf", false)) { LogPrintf("Warning: %s\n", error); } else { - return ConfigError{ConfigStatus::FAILED, Untranslated(error)}; + return ConfigError{ConfigStatus::FAILED, error}; } } @@ -92,7 +91,7 @@ std::optional InitConfig(ArgsManager& args, SettingsAbortFn setting if (args.GetSettingsPath()) { std::vector details; if (!args.ReadSettingsFile(&details)) { - const bilingual_str& message = _("Settings file could not be read"); + const std::string& message = "Settings file could not be read"; if (!settings_abort_fn) { return ConfigError{ConfigStatus::FAILED, message, details}; } else if (settings_abort_fn(message, details)) { @@ -102,12 +101,12 @@ std::optional InitConfig(ArgsManager& args, SettingsAbortFn setting } } if (!args.WriteSettingsFile(&details)) { - const bilingual_str& message = _("Settings file could not be written"); + const std::string& message = "Settings file could not be written"; return ConfigError{ConfigStatus::FAILED_WRITE, message, details}; } } } catch (const std::exception& e) { - return ConfigError{ConfigStatus::FAILED, Untranslated(e.what())}; + return ConfigError{ConfigStatus::FAILED, e.what()}; } return {}; } diff --git a/src/common/init.h b/src/common/init.h index 380ac3ac7e7089..9b3abb06e9864d 100644 --- a/src/common/init.h +++ b/src/common/init.h @@ -5,7 +5,6 @@ #ifndef BITCOIN_COMMON_INIT_H #define BITCOIN_COMMON_INIT_H -#include #include #include @@ -23,14 +22,14 @@ enum class ConfigStatus { struct ConfigError { ConfigStatus status; - bilingual_str message{}; + std::string message{}; std::vector details{}; }; //! Callback function to let the user decide whether to abort loading if //! settings.json file exists and can't be parsed, or to ignore the error and //! overwrite the file. -using SettingsAbortFn = std::function& details)>; +using SettingsAbortFn = std::function& details)>; /* Read config files, and create datadir and settings.json if they don't exist. */ std::optional InitConfig(ArgsManager& args, SettingsAbortFn settings_abort_fn = nullptr); diff --git a/src/core_read.cpp b/src/core_read.cpp index e32e46d1b9b4ab..d4923c52da202e 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -256,6 +256,6 @@ util::Result SighashFromStr(const std::string& sighash) if (it != map_sighash_values.end()) { return it->second; } else { - return util::Error{Untranslated(sighash + " is not a valid sighash parameter.")}; + return util::Error{sighash + " is not a valid sighash parameter."}; } } diff --git a/src/core_write.cpp b/src/core_write.cpp index 63f2c36b5af238..4844b9afbbfaa4 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -14,6 +14,7 @@ #include