Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ if test "x$enable_werror" = "xyes"; then
dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010
AX_CHECK_COMPILE_FLAG([-Werror=suggest-override],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=suggest-override"],,[[$CXXFLAG_WERROR]],
[AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])])
AX_CHECK_COMPILE_FLAG([-Werror=unreachable-code-loop-increment],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=unreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
fi

if test "x$CXXFLAGS_overridden" = "xno"; then
Expand All @@ -445,6 +446,7 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wconditional-uninitialized],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wconditional-uninitialized"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wsuggest-override],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"],,[[$CXXFLAG_WERROR]],
[AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])])
AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])

## Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
## unknown options if any other warning is produced. Test the -Wfoo case, and
Expand Down
3 changes: 2 additions & 1 deletion doc/translation_strings_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ On a high level, these strings are to be translated:

### GUI strings

Anything that appears to the user in the GUI is to be translated. This includes labels, menu items, button texts, tooltips and window titles.
Do not translate technical or extremely rare errors.
Anything else that appears to the user in the GUI is to be translated. This includes labels, menu items, button texts, tooltips and window titles.
This includes messages passed to the GUI through the UI interface through `InitMessage`, `ThreadSafeMessageBox` or `ShowProgress`.

General recommendations
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ bool CCoinJoinClientManager::CheckAutomaticBackup()
if (!mixingWallet.AutoBackupWallet("", errorString, warnings)) {
if (!warnings.empty()) {
// There were some issues saving backup but yet more or less safe to continue
LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::CheckAutomaticBackup -- WARNING! Something went wrong on automatic backup: %s\n", Join(warnings, "\n", OpTranslated));
LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::CheckAutomaticBackup -- WARNING! Something went wrong on automatic backup: %s\n", Join(warnings, Untranslated("\n")).translated);
}
if (!errorString.original.empty()) {
// Things are really broken
Expand Down
14 changes: 7 additions & 7 deletions src/dashd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static bool AppInit(int argc, char* argv[])
SetupServerArgs();
std::string error;
if (!gArgs.ParseParameters(argc, argv, error)) {
return InitError(strprintf("Error parsing command line arguments: %s\n", error));
return InitError(Untranslated(strprintf("Error parsing command line arguments: %s\n", error)));
}

if (gArgs.IsArgSet("-printcrashinfo")) {
Expand Down Expand Up @@ -87,10 +87,10 @@ static bool AppInit(int argc, char* argv[])
bool datadirFromCmdLine = gArgs.IsArgSet("-datadir");
if (datadirFromCmdLine && !fs::is_directory(GetDataDir(false)))
{
return InitError(strprintf("Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "")));
return InitError(Untranslated(strprintf("Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", ""))));
}
if (!gArgs.ReadConfigFiles(error, true)) {
return InitError(strprintf("Error reading configuration file: %s\n", error));
return InitError(Untranslated(strprintf("Error reading configuration file: %s\n", error)));
}
if (!datadirFromCmdLine && !fs::is_directory(GetDataDir(false)))
{
Expand All @@ -101,13 +101,13 @@ static bool AppInit(int argc, char* argv[])
try {
SelectParams(gArgs.GetChainName());
} catch (const std::exception& e) {
return InitError(strprintf("%s\n", e.what()));
return InitError(Untranslated(strprintf("%s\n", e.what())));
}

// 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(strprintf("Command line contains unexpected token '%s', see dashd -h for a list of options.\n", argv[i]));
return InitError(Untranslated(strprintf("Command line contains unexpected token '%s', see dashd -h for a list of options.\n", argv[i])));
}
}

Expand Down Expand Up @@ -142,13 +142,13 @@ static bool AppInit(int argc, char* argv[])

// Daemonize
if (daemon(1, 0)) { // don't chdir (1), do close FDs (0)
return InitError(strprintf("daemon() failed: %s\n", strerror(errno)));
return InitError(Untranslated(strprintf("daemon() failed: %s\n", strerror(errno))));
}
#if defined(MAC_OSX)
#pragma GCC diagnostic pop
#endif
#else
return InitError("-daemon is not supported on this operating system\n");
return InitError(Untranslated("-daemon is not supported on this operating system\n"));
#endif // HAVE_DECL_DAEMON
}
// Lock data directory after daemonization
Expand Down
2 changes: 1 addition & 1 deletion src/httprpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static bool InitRPCAuthentication()
LogPrintf("Using random cookie authentication.\n");
if (!GenerateAuthCookie(&strRPCUserColonPass)) {
uiInterface.ThreadSafeMessageBox(
_("Error: A fatal internal error occurred, see debug.log for details").translated, // Same message as AbortNode
_("Error: A fatal internal error occurred, see debug.log for details"), // Same message as AbortNode
"", CClientUIInterface::MSG_ERROR);
return false;
}
Expand Down
9 changes: 5 additions & 4 deletions src/httpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
#include <httpserver.h>

#include <chainparamsbase.h>
#include <util/system.h>
#include <util/strencodings.h>
#include <util/threadnames.h>
#include <netbase.h>
#include <rpc/protocol.h> // For HTTP status codes
#include <shutdown.h>
#include <sync.h>
#include <ui_interface.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/threadnames.h>
#include <util/translation.h>

#include <deque>
#include <stdio.h>
Expand Down Expand Up @@ -173,7 +174,7 @@ static bool InitHTTPAllowList()
LookupSubNet(strAllow.c_str(), subnet);
if (!subnet.IsValid()) {
uiInterface.ThreadSafeMessageBox(
strprintf("Invalid -rpcallowip subnet specification: %s. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24).", strAllow),
strprintf(Untranslated("Invalid -rpcallowip subnet specification: %s. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24)."), strAllow),
"", CClientUIInterface::MSG_ERROR);
return false;
}
Expand Down
7 changes: 3 additions & 4 deletions src/index/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <shutdown.h>
#include <tinyformat.h>
#include <ui_interface.h>
#include <util/translation.h>
#include <validation.h>
#include <warnings.h>

Expand All @@ -15,15 +16,13 @@ constexpr char DB_BEST_BLOCK = 'B';
constexpr int64_t SYNC_LOG_INTERVAL = 30; // seconds
constexpr int64_t SYNC_LOCATOR_WRITE_INTERVAL = 30; // seconds

template<typename... Args>
template <typename... Args>
static void FatalError(const char* fmt, const Args&... args)
{
std::string strMessage = tfm::format(fmt, args...);
SetMiscWarning(strMessage);
LogPrintf("*** %s\n", strMessage);
uiInterface.ThreadSafeMessageBox(
"Error: A fatal internal error occurred, see debug.log for details",
"", CClientUIInterface::MSG_ERROR);
AbortError(_("A fatal internal error occurred, see debug.log for details"));
StartShutdown();
}

Expand Down
Loading