mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-08 13:49:35 +02:00
Merge #18922: gui: Do not translate InitWarning messages in debug.log
78be8d97d3util: Drop OpOriginal() and OpTranslated() (Hennadii Stepanov)da16f95c3fgui: Do not translate InitWarning messages in debug.log (Hennadii Stepanov)4c9b9a4882util: Enhance Join() (Hennadii Stepanov)fe05dd0611util: Enhance bilingual_str (Hennadii Stepanov) Pull request description: This PR forces the `bitcoin-qt` to write `InitWarning()` messages to the `debug.log` file in untranslated form, i.e., in English. On master (376294cde6): ``` $ ./src/qt/bitcoin-qt -lang=nl -debug=vladidation -printtoconsole | grep 'vladi' Warning: Niet-ondersteunde logcategorie -debug=vladidation. 2020-05-09T12:39:59Z Warning: Niet-ondersteunde logcategorie -debug=vladidation. 2020-05-09T12:40:02Z Command-line arg: debug="vladidation" ``` With this PR: ``` $ ./src/qt/bitcoin-qt -lang=nl -debug=vladidation -printtoconsole | grep 'vladi' Warning: Unsupported logging category -debug=vladidation. 2020-05-09T12:42:04Z Warning: Unsupported logging category -debug=vladidation. 2020-05-09T12:42:35Z Command-line arg: debug="vladidation" ```  Related to #16218. ACKs for top commit: laanwj: ACK78be8d97d3jonasschnelli: utACK78be8d97d3MarcoFalke: ACK78be8d97d3📢 Tree-SHA512: 48e9ecd23c4dd8ec262e3eb94f8e30944bcc9c6c163245fb837b2e0c484d4d0b4f47f7abc638c14edc27d635d340ba3ee4ba4506b062399e9cf59a1564c98755
This commit is contained in:
@@ -56,7 +56,7 @@ bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wal
|
||||
bilingual_str error_string;
|
||||
std::vector<bilingual_str> warnings;
|
||||
bool verify_success = CWallet::Verify(chain, location, salvage_wallet, error_string, warnings);
|
||||
if (!warnings.empty()) chain.initWarning(Join(warnings, "\n", OpTranslated));
|
||||
if (!warnings.empty()) chain.initWarning(Join(warnings, Untranslated("\n")));
|
||||
if (!verify_success) {
|
||||
chain.initError(error_string);
|
||||
return false;
|
||||
@@ -73,7 +73,7 @@ bool LoadWallets(interfaces::Chain& chain, const std::vector<std::string>& walle
|
||||
bilingual_str error;
|
||||
std::vector<bilingual_str> warnings;
|
||||
std::shared_ptr<CWallet> pwallet = CWallet::CreateWalletFromFile(chain, WalletLocation(walletFile), error, warnings);
|
||||
if (!warnings.empty()) chain.initWarning(Join(warnings, "\n", OpTranslated));
|
||||
if (!warnings.empty()) chain.initWarning(Join(warnings, Untranslated("\n")));
|
||||
if (!pwallet) {
|
||||
chain.initError(error);
|
||||
return false;
|
||||
|
||||
@@ -2603,7 +2603,7 @@ static UniValue loadwallet(const JSONRPCRequest& request)
|
||||
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.pushKV("name", wallet->GetName());
|
||||
obj.pushKV("warning", Join(warnings, "\n", OpOriginal));
|
||||
obj.pushKV("warning", Join(warnings, Untranslated("\n")).original);
|
||||
|
||||
return obj;
|
||||
}
|
||||
@@ -2743,7 +2743,7 @@ static UniValue createwallet(const JSONRPCRequest& request)
|
||||
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.pushKV("name", wallet->GetName());
|
||||
obj.pushKV("warning", Join(warnings, "\n", OpOriginal));
|
||||
obj.pushKV("warning", Join(warnings, Untranslated("\n")).original);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user