Skip to content

Commit

Permalink
refactor: Use + instead of strformat to concatenate translated & untr…
Browse files Browse the repository at this point in the history
…anslated strings

This change is needed to let the scripted-diff commit following this compile.

It should also make code a little more obvious and easy to read.
  • Loading branch information
ryanofsky committed Oct 12, 2024
1 parent fd18865 commit fdd1992
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/node/interface_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool InitError(const bilingual_str& str, const std::vector<std::string>& details
// functions which provide error details are ones that run during early init
// before the GUI uiInterface is registered, so there's no point passing
// main messages and details separately to uiInterface yet.
return InitError(details.empty() ? str : strprintf(Untranslated("%s:\n%s"), str, MakeUnorderedList(details)));
return InitError(details.empty() ? str : str + Untranslated(strprintf(":\n%s", MakeUnorderedList(details))));
}

void InitWarning(const bilingual_str& str)
Expand Down
2 changes: 1 addition & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6091,7 +6091,7 @@ SnapshotCompletionResult ChainstateManager::MaybeCompleteSnapshotValidation()

auto rename_result = m_snapshot_chainstate->InvalidateCoinsDBOnDisk();
if (!rename_result) {
user_error = strprintf(Untranslated("%s\n%s"), user_error, util::ErrorString(rename_result));
user_error += Untranslated("\n") + util::ErrorString(rename_result);
}

GetNotifications().fatalError(user_error);
Expand Down

0 comments on commit fdd1992

Please sign in to comment.