Skip to content

Commit da16f95

Browse files
committed
gui: Do not translate InitWarning messages in debug.log
1 parent 4c9b9a4 commit da16f95

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

src/init.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ bool AppInitParameterInteraction()
971971

972972
// Warn if unrecognized section name are present in the config file.
973973
for (const auto& section : gArgs.GetUnrecognizedSections()) {
974-
InitWarning(strprintf("%s:%i " + _("Section [%s] is not recognized.").translated, section.m_file, section.m_line, section.m_name));
974+
InitWarning(strprintf(Untranslated("%s:%i ") + _("Section [%s] is not recognized."), section.m_file, section.m_line, section.m_name));
975975
}
976976

977977
if (!fs::is_directory(GetBlocksDir())) {
@@ -1027,7 +1027,7 @@ bool AppInitParameterInteraction()
10271027
nMaxConnections = std::min(nFD - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS, nMaxConnections);
10281028

10291029
if (nMaxConnections < nUserMaxConnections)
1030-
InitWarning(strprintf(_("Reducing -maxconnections from %d to %d, because of system limitations.").translated, nUserMaxConnections, nMaxConnections));
1030+
InitWarning(strprintf(_("Reducing -maxconnections from %d to %d, because of system limitations."), nUserMaxConnections, nMaxConnections));
10311031

10321032
// ********************************************************* Step 3: parameter-to-internal-flags
10331033
if (gArgs.IsArgSet("-debug")) {
@@ -1038,7 +1038,7 @@ bool AppInitParameterInteraction()
10381038
[](std::string cat){return cat == "0" || cat == "none";})) {
10391039
for (const auto& cat : categories) {
10401040
if (!LogInstance().EnableCategory(cat)) {
1041-
InitWarning(strprintf(_("Unsupported logging category %s=%s.").translated, "-debug", cat));
1041+
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debug", cat));
10421042
}
10431043
}
10441044
}
@@ -1047,7 +1047,7 @@ bool AppInitParameterInteraction()
10471047
// Now remove the logging categories which were explicitly excluded
10481048
for (const std::string& cat : gArgs.GetArgs("-debugexclude")) {
10491049
if (!LogInstance().DisableCategory(cat)) {
1050-
InitWarning(strprintf(_("Unsupported logging category %s=%s.").translated, "-debugexclude", cat));
1050+
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat));
10511051
}
10521052
}
10531053

@@ -1260,7 +1260,7 @@ bool AppInitMain(NodeContext& node)
12601260
LogPrintf("Config file: %s\n", config_file_path.string());
12611261
} else if (gArgs.IsArgSet("-conf")) {
12621262
// Warn if no conf file exists at path provided by user
1263-
InitWarning(strprintf(_("The specified config file %s does not exist\n").translated, config_file_path.string()));
1263+
InitWarning(strprintf(_("The specified config file %s does not exist\n"), config_file_path.string()));
12641264
} else {
12651265
// Not categorizing as "Warning" because it's the default behavior
12661266
LogPrintf("Config file: %s (not found, skipping)\n", config_file_path.string());

src/interfaces/chain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class ChainImpl : public Chain
344344
bool shutdownRequested() override { return ShutdownRequested(); }
345345
int64_t getAdjustedTime() override { return GetAdjustedTime(); }
346346
void initMessage(const std::string& message) override { ::uiInterface.InitMessage(message); }
347-
void initWarning(const std::string& message) override { InitWarning(message); }
347+
void initWarning(const bilingual_str& message) override { InitWarning(message); }
348348
void initError(const bilingual_str& message) override { InitError(message); }
349349
void showProgress(const std::string& title, int progress, bool resume_possible) override
350350
{

src/interfaces/chain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class Chain
225225
virtual void initMessage(const std::string& message) = 0;
226226

227227
//! Send init warning.
228-
virtual void initWarning(const std::string& message) = 0;
228+
virtual void initWarning(const bilingual_str& message) = 0;
229229

230230
//! Send init error.
231231
virtual void initError(const bilingual_str& message) = 0;

src/ui_interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bool InitError(const bilingual_str& str)
5959
return false;
6060
}
6161

62-
void InitWarning(const std::string& str)
62+
void InitWarning(const bilingual_str& str)
6363
{
64-
uiInterface.ThreadSafeMessageBox(Untranslated(str), "", CClientUIInterface::MSG_WARNING);
64+
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING);
6565
}

src/ui_interface.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ class CClientUIInterface
120120
};
121121

122122
/** Show warning message **/
123-
// TODO: InitWarning() should take a bilingual_str parameter.
124-
void InitWarning(const std::string& str);
123+
void InitWarning(const bilingual_str& str);
125124

126125
/** Show error message **/
127126
bool InitError(const bilingual_str& str);

src/wallet/load.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wal
5656
bilingual_str error_string;
5757
std::vector<bilingual_str> warnings;
5858
bool verify_success = CWallet::Verify(chain, location, salvage_wallet, error_string, warnings);
59-
if (!warnings.empty()) chain.initWarning(Join(warnings, "\n", OpTranslated));
59+
if (!warnings.empty()) chain.initWarning(Join(warnings, Untranslated("\n")));
6060
if (!verify_success) {
6161
chain.initError(error_string);
6262
return false;
@@ -73,7 +73,7 @@ bool LoadWallets(interfaces::Chain& chain, const std::vector<std::string>& walle
7373
bilingual_str error;
7474
std::vector<bilingual_str> warnings;
7575
std::shared_ptr<CWallet> pwallet = CWallet::CreateWalletFromFile(chain, WalletLocation(walletFile), error, warnings);
76-
if (!warnings.empty()) chain.initWarning(Join(warnings, "\n", OpTranslated));
76+
if (!warnings.empty()) chain.initWarning(Join(warnings, Untranslated("\n")));
7777
if (!pwallet) {
7878
chain.initError(error);
7979
return false;

0 commit comments

Comments
 (0)