Merge #16291: gui: Stop translating PACKAGE_NAME (#4723)

* Merge #16291: gui: Stop translating PACKAGE_NAME

fa64b947bb3075ff8737656706b941af691908ab util: No translation of `Bitcoin Core` in the copyright (MarcoFalke)
fab85208f678ba1be53bdb73a73ce3c5c937d448 qt: Run «make translate» in ./src/ (MarcoFalke)
fabe87d2c923ab3a70b8cde2666a4d1cda8b22fb scripted-diff: Avoid passing PACKAGE_NAME for translation (MarcoFalke)
fa5e9f157e568b7fbbea1482b393181f0733f2ba build: Stop translating PACKAGE_NAME (MarcoFalke)

Pull request description:

  Generally the package name is not translated, but the package description is.

  E.g. `GIMP` or `Firefox` are always called that way regardless of the system language. However, "`Firefox` webbrowser" or "`GIMP` image manipulation program" are translated.

ACKs for top commit:
  hebasto:
    ACK fa64b947bb3075ff8737656706b941af691908ab, I have not tested the code, but I have reviewed it and it looks OK, I agree it can be merged.

Tree-SHA512: 626f811531182d0ba0ef1044930d32726773349bcb49b10261288a86ee6b80a183db30a87d817d5b0d501fad058ac22d6272311716b4f5a154f17c6f391a5a1a

* more

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
This commit is contained in:
PastaPastaPasta 2022-03-14 16:39:32 -05:00 committed by GitHub
parent dea09ce899
commit 18c59b6263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 49 additions and 51 deletions

View File

@ -76,10 +76,7 @@ f.write("""
#endif #endif
""") """)
f.write('static const char UNUSED *dash_strings[] = {\n') f.write('static const char UNUSED *dash_strings[] = {\n')
f.write('QT_TRANSLATE_NOOP("dash-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),))
f.write('QT_TRANSLATE_NOOP("dash-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),)) f.write('QT_TRANSLATE_NOOP("dash-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),))
if os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION') != os.getenv('PACKAGE_NAME'):
f.write('QT_TRANSLATE_NOOP("dash-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION'),))
messages.sort(key=operator.itemgetter(0)) messages.sort(key=operator.itemgetter(0))
for (msgid, msgstr) in messages: for (msgid, msgstr) in messages:
if msgid != EMPTY: if msgid != EMPTY:

View File

@ -427,7 +427,7 @@ SECONDARY: $(QT_QM)
$(srcdir)/qt/dashstrings.cpp: FORCE $(srcdir)/qt/dashstrings.cpp: FORCE
@test -n $(XGETTEXT) || echo "xgettext is required for updating translations" @test -n $(XGETTEXT) || echo "xgettext is required for updating translations"
$(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" COPYRIGHT_HOLDERS_SUBSTITUTION="$(COPYRIGHT_HOLDERS_SUBSTITUTION)" $(PYTHON) ../share/qt/extract_strings_qt.py $(libdash_server_a_SOURCES) $(libdash_wallet_a_SOURCES) $(libdash_common_a_SOURCES) $(libdash_zmq_a_SOURCES) $(libdash_consensus_a_SOURCES) $(libdash_util_a_SOURCES) $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" $(PYTHON) ../share/qt/extract_strings_qt.py $(libdash_server_a_SOURCES) $(libdash_wallet_a_SOURCES) $(libdash_common_a_SOURCES) $(libdash_zmq_a_SOURCES) $(libdash_consensus_a_SOURCES) $(libdash_util_a_SOURCES)
translate: $(srcdir)/qt/dashstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_BASE_CPP) qt/dash.cpp $(BITCOIN_QT_WINDOWS_CPP) $(BITCOIN_QT_WALLET_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) translate: $(srcdir)/qt/dashstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_BASE_CPP) qt/dash.cpp $(BITCOIN_QT_WINDOWS_CPP) $(BITCOIN_QT_WALLET_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)
@test -n $(LUPDATE) || echo "lupdate is required for updating translations" @test -n $(LUPDATE) || echo "lupdate is required for updating translations"

View File

@ -1576,7 +1576,7 @@ static bool LockDataDirectory(bool probeOnly)
return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions."), datadir.string())); return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions."), datadir.string()));
} }
if (!LockDirectory(datadir, ".lock", probeOnly)) { if (!LockDirectory(datadir, ".lock", probeOnly)) {
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), datadir.string(), _(PACKAGE_NAME))); return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), datadir.string(), PACKAGE_NAME));
} }
return true; return true;
} }
@ -1594,7 +1594,7 @@ bool AppInitSanityChecks()
// Sanity check // Sanity check
if (!InitSanityCheck()) if (!InitSanityCheck())
return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), _(PACKAGE_NAME))); return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), PACKAGE_NAME));
// Probe the data directory lock to give an early error message, if possible // Probe the data directory lock to give an early error message, if possible
// We cannot hold the data directory lock here, as the forking for daemon() hasn't yet happened, // We cannot hold the data directory lock here, as the forking for daemon() hasn't yet happened,

View File

@ -2656,7 +2656,7 @@ bool CConnman::BindListenPort(const CService& addrBind, std::string& strError, N
{ {
int nErr = WSAGetLastError(); int nErr = WSAGetLastError();
if (nErr == WSAEADDRINUSE) if (nErr == WSAEADDRINUSE)
strError = strprintf(_("Unable to bind to %s on this computer. %s is probably already running."), addrBind.ToString(), _(PACKAGE_NAME)); strError = strprintf(_("Unable to bind to %s on this computer. %s is probably already running."), addrBind.ToString(), PACKAGE_NAME);
else else
strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %s)"), addrBind.ToString(), NetworkErrorString(nErr)); strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %s)"), addrBind.ToString(), NetworkErrorString(nErr));
LogPrintf("%s\n", strError); LogPrintf("%s\n", strError);

View File

@ -368,15 +368,15 @@ void BitcoinGUI::createActions()
quitAction->setStatusTip(tr("Quit application")); quitAction->setStatusTip(tr("Quit application"));
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
quitAction->setMenuRole(QAction::QuitRole); quitAction->setMenuRole(QAction::QuitRole);
aboutAction = new QAction(tr("&About %1").arg(tr(PACKAGE_NAME)), this); aboutAction = new QAction(tr("&About %1").arg(PACKAGE_NAME), this);
aboutAction->setStatusTip(tr("Show information about Dash Core")); aboutAction->setStatusTip(tr("Show information about %1").arg(PACKAGE_NAME));
aboutAction->setMenuRole(QAction::AboutRole); aboutAction->setMenuRole(QAction::AboutRole);
aboutAction->setEnabled(false); aboutAction->setEnabled(false);
aboutQtAction = new QAction(tr("About &Qt"), this); aboutQtAction = new QAction(tr("About &Qt"), this);
aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setStatusTip(tr("Show information about Qt"));
aboutQtAction->setMenuRole(QAction::AboutQtRole); aboutQtAction->setMenuRole(QAction::AboutQtRole);
optionsAction = new QAction(tr("&Options..."), this); optionsAction = new QAction(tr("&Options..."), this);
optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(tr(PACKAGE_NAME))); optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(PACKAGE_NAME));
optionsAction->setMenuRole(QAction::PreferencesRole); optionsAction->setMenuRole(QAction::PreferencesRole);
optionsAction->setEnabled(false); optionsAction->setEnabled(false);
toggleHideAction = new QAction(tr("&Show / Hide"), this); toggleHideAction = new QAction(tr("&Show / Hide"), this);
@ -438,7 +438,7 @@ void BitcoinGUI::createActions()
showHelpMessageAction = new QAction(tr("&Command-line options"), this); showHelpMessageAction = new QAction(tr("&Command-line options"), this);
showHelpMessageAction->setMenuRole(QAction::NoRole); showHelpMessageAction->setMenuRole(QAction::NoRole);
showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Dash command-line options").arg(tr(PACKAGE_NAME))); showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Dash command-line options").arg(PACKAGE_NAME));
showCoinJoinHelpAction = new QAction(tr("%1 &information").arg(strCoinJoinName), this); showCoinJoinHelpAction = new QAction(tr("%1 &information").arg(strCoinJoinName), this);
showCoinJoinHelpAction->setMenuRole(QAction::NoRole); showCoinJoinHelpAction->setMenuRole(QAction::NoRole);
@ -974,7 +974,7 @@ void BitcoinGUI::createTrayIcon()
if (QSystemTrayIcon::isSystemTrayAvailable()) { if (QSystemTrayIcon::isSystemTrayAvailable()) {
trayIcon = new QSystemTrayIcon(m_network_style->getTrayAndWindowIcon(), this); trayIcon = new QSystemTrayIcon(m_network_style->getTrayAndWindowIcon(), this);
QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + m_network_style->getTitleAddText(); QString toolTip = tr("%1 client").arg(PACKAGE_NAME) + " " + m_network_style->getTitleAddText();
trayIcon->setToolTip(toolTip); trayIcon->setToolTip(toolTip);
} }
} }
@ -1857,7 +1857,7 @@ void BitcoinGUI::updateProxyIcon()
void BitcoinGUI::updateWindowTitle() void BitcoinGUI::updateWindowTitle()
{ {
QString window_title = tr(PACKAGE_NAME); QString window_title = PACKAGE_NAME;
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
if (walletFrame) { if (walletFrame) {
WalletModel* const wallet_model = walletFrame->currentWalletModel(); WalletModel* const wallet_model = walletFrame->currentWalletModel();

View File

@ -480,7 +480,7 @@ int GuiMain(int argc, char* argv[])
SetupUIArgs(); SetupUIArgs();
std::string error; std::string error;
if (!node->parseParameters(argc, argv, error)) { if (!node->parseParameters(argc, argv, error)) {
QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME), QMessageBox::critical(nullptr, PACKAGE_NAME,
QObject::tr("Error parsing command line arguments: %1.").arg(QString::fromStdString(error))); QObject::tr("Error parsing command line arguments: %1.").arg(QString::fromStdString(error)));
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -500,7 +500,7 @@ int GuiMain(int argc, char* argv[])
if (gArgs.IsArgSet("-printcrashinfo")) { if (gArgs.IsArgSet("-printcrashinfo")) {
auto crashInfo = GetCrashInfoStrFromSerializedStr(gArgs.GetArg("-printcrashinfo", "")); auto crashInfo = GetCrashInfoStrFromSerializedStr(gArgs.GetArg("-printcrashinfo", ""));
std::cout << crashInfo << std::endl; std::cout << crashInfo << std::endl;
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QString::fromStdString(crashInfo)); QMessageBox::critical(0, PACKAGE_NAME, QString::fromStdString(crashInfo));
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
@ -524,12 +524,12 @@ int GuiMain(int argc, char* argv[])
/// - Do not call GetDataDir(true) before this step finishes /// - Do not call GetDataDir(true) before this step finishes
if (!fs::is_directory(GetDataDir(false))) if (!fs::is_directory(GetDataDir(false)))
{ {
QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME), QMessageBox::critical(nullptr, PACKAGE_NAME,
QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(gArgs.GetArg("-datadir", "")))); QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(gArgs.GetArg("-datadir", ""))));
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (!node->readConfigFiles(error)) { if (!node->readConfigFiles(error)) {
QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME), QMessageBox::critical(nullptr, PACKAGE_NAME,
QObject::tr("Error: Cannot parse configuration file: %1.").arg(QString::fromStdString(error))); QObject::tr("Error: Cannot parse configuration file: %1.").arg(QString::fromStdString(error)));
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -544,7 +544,7 @@ int GuiMain(int argc, char* argv[])
try { try {
node->selectParams(gArgs.GetChainName()); node->selectParams(gArgs.GetChainName());
} catch(std::exception &e) { } catch(std::exception &e) {
QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME), QObject::tr("Error: %1").arg(e.what())); QMessageBox::critical(nullptr, PACKAGE_NAME, QObject::tr("Error: %1").arg(e.what()));
return EXIT_FAILURE; return EXIT_FAILURE;
} }
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
@ -589,7 +589,7 @@ int GuiMain(int argc, char* argv[])
app.parameterSetup(); app.parameterSetup();
// Load custom application fonts and setup font management // Load custom application fonts and setup font management
if (!GUIUtil::loadFonts()) { if (!GUIUtil::loadFonts()) {
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QMessageBox::critical(0, PACKAGE_NAME,
QObject::tr("Error: Failed to load application fonts.")); QObject::tr("Error: Failed to load application fonts."));
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -602,7 +602,7 @@ int GuiMain(int argc, char* argv[])
try { try {
family = GUIUtil::fontFamilyFromString(strFamily); family = GUIUtil::fontFamilyFromString(strFamily);
} catch (const std::exception& e) { } catch (const std::exception& e) {
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QMessageBox::critical(0, PACKAGE_NAME,
QObject::tr("Error: Specified font-family invalid. Valid values: %1.").arg("SystemDefault, Montserrat")); QObject::tr("Error: Specified font-family invalid. Valid values: %1.").arg("SystemDefault, Montserrat"));
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -612,7 +612,7 @@ int GuiMain(int argc, char* argv[])
if (gArgs.IsArgSet("-font-weight-normal")) { if (gArgs.IsArgSet("-font-weight-normal")) {
QFont::Weight weight; QFont::Weight weight;
if (!GUIUtil::weightFromArg(gArgs.GetArg("-font-weight-normal", GUIUtil::weightToArg(GUIUtil::getFontWeightNormal())), weight)) { if (!GUIUtil::weightFromArg(gArgs.GetArg("-font-weight-normal", GUIUtil::weightToArg(GUIUtil::getFontWeightNormal())), weight)) {
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QMessageBox::critical(0, PACKAGE_NAME,
QObject::tr("Error: Specified font-weight-normal invalid. Valid range %1 to %2.").arg(0).arg(8)); QObject::tr("Error: Specified font-weight-normal invalid. Valid range %1 to %2.").arg(0).arg(8));
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -622,7 +622,7 @@ int GuiMain(int argc, char* argv[])
if (gArgs.IsArgSet("-font-weight-bold")) { if (gArgs.IsArgSet("-font-weight-bold")) {
QFont::Weight weight; QFont::Weight weight;
if (!GUIUtil::weightFromArg(gArgs.GetArg("-font-weight-bold", GUIUtil::weightToArg(GUIUtil::getFontWeightBold())), weight)) { if (!GUIUtil::weightFromArg(gArgs.GetArg("-font-weight-bold", GUIUtil::weightToArg(GUIUtil::getFontWeightBold())), weight)) {
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QMessageBox::critical(0, PACKAGE_NAME,
QObject::tr("Error: Specified font-weight-bold invalid. Valid range %1 to %2.").arg(0).arg(8)); QObject::tr("Error: Specified font-weight-bold invalid. Valid range %1 to %2.").arg(0).arg(8));
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -633,7 +633,7 @@ int GuiMain(int argc, char* argv[])
const int nScaleMin = -100, nScaleMax = 100; const int nScaleMin = -100, nScaleMax = 100;
int nScale = gArgs.GetArg("-font-scale", GUIUtil::getFontScale()); int nScale = gArgs.GetArg("-font-scale", GUIUtil::getFontScale());
if (nScale < nScaleMin || nScale > nScaleMax) { if (nScale < nScaleMin || nScale > nScaleMax) {
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QMessageBox::critical(0, PACKAGE_NAME,
QObject::tr("Error: Specified font-scale invalid. Valid range %1 to %2.").arg(nScaleMin).arg(nScaleMax)); QObject::tr("Error: Specified font-scale invalid. Valid range %1 to %2.").arg(nScaleMin).arg(nScaleMax));
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -647,7 +647,7 @@ int GuiMain(int argc, char* argv[])
QString strFile; QString strFile;
if (!fs::is_directory(customDir)) { if (!fs::is_directory(customDir)) {
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QMessageBox::critical(0, PACKAGE_NAME,
QObject::tr("Error: Invalid -custom-css-dir path.") + "\n\n" + strCustomDir); QObject::tr("Error: Invalid -custom-css-dir path.") + "\n\n" + strCustomDir);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -667,7 +667,7 @@ int GuiMain(int argc, char* argv[])
for (const auto& strMissingFile : vecRequiredFiles) { for (const auto& strMissingFile : vecRequiredFiles) {
strMissingFiles += strMissingFile + "\n"; strMissingFiles += strMissingFile + "\n";
} }
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QMessageBox::critical(0, PACKAGE_NAME,
QObject::tr("Error: %1 CSS file(s) missing in -custom-css-dir path.").arg(vecRequiredFiles.size()) + "\n\n" + strMissingFiles); QObject::tr("Error: %1 CSS file(s) missing in -custom-css-dir path.").arg(vecRequiredFiles.size()) + "\n\n" + strMissingFiles);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -676,7 +676,7 @@ int GuiMain(int argc, char* argv[])
} }
// Validate -debug-ui // Validate -debug-ui
if (gArgs.GetBoolArg("-debug-ui", false)) { if (gArgs.GetBoolArg("-debug-ui", false)) {
QMessageBox::warning(0, QObject::tr(PACKAGE_NAME), QMessageBox::warning(0, PACKAGE_NAME,
"Warning: UI debug mode (-debug-ui) enabled" + QString(gArgs.IsArgSet("-custom-css-dir") ? "." : " without a custom css directory set with -custom-css-dir.")); "Warning: UI debug mode (-debug-ui) enabled" + QString(gArgs.IsArgSet("-custom-css-dir") ? "." : " without a custom css directory set with -custom-css-dir."));
} }
@ -693,7 +693,7 @@ int GuiMain(int argc, char* argv[])
if (app.baseInitialize()) { if (app.baseInitialize()) {
app.requestInitialize(); app.requestInitialize();
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(QObject::tr(PACKAGE_NAME)), (HWND)app.getMainWinId()); WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(PACKAGE_NAME), (HWND)app.getMainWinId());
#endif #endif
app.exec(); app.exec();
app.requestShutdown(); app.requestShutdown();

View File

@ -284,7 +284,7 @@ void setupAppearance(QWidget* parent, OptionsModel* model)
dlg.setWindowTitle(QObject::tr("Appearance Setup")); dlg.setWindowTitle(QObject::tr("Appearance Setup"));
dlg.setWindowIcon(QIcon(":icons/dash")); dlg.setWindowIcon(QIcon(":icons/dash"));
// And the widgets we add to it // And the widgets we add to it
QLabel lblHeading(QObject::tr("Please choose your preferred settings for the appearance of %1").arg(QObject::tr(PACKAGE_NAME)), &dlg); QLabel lblHeading(QObject::tr("Please choose your preferred settings for the appearance of %1").arg(PACKAGE_NAME), &dlg);
lblHeading.setObjectName("lblHeading"); lblHeading.setObjectName("lblHeading");
lblHeading.setWordWrap(true); lblHeading.setWordWrap(true);
QLabel lblSubHeading(QObject::tr("This can also be adjusted later in the \"Appearance\" tab of the preferences."), &dlg); QLabel lblSubHeading(QObject::tr("This can also be adjusted later in the \"Appearance\" tab of the preferences."), &dlg);

View File

@ -120,16 +120,16 @@ Intro::Intro(QWidget *parent, uint64_t blockchain_size, uint64_t chain_state_siz
m_chain_state_size(chain_state_size) m_chain_state_size(chain_state_size)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(tr(PACKAGE_NAME))); ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(PACKAGE_NAME));
ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME))); ui->storageLabel->setText(ui->storageLabel->text().arg(PACKAGE_NAME));
ui->lblExplanation1->setText(ui->lblExplanation1->text() ui->lblExplanation1->setText(ui->lblExplanation1->text()
.arg(tr(PACKAGE_NAME)) .arg(PACKAGE_NAME)
.arg(m_blockchain_size) .arg(m_blockchain_size)
.arg(2014) .arg(2014)
.arg("Dash") .arg("Dash")
); );
ui->lblExplanation2->setText(ui->lblExplanation2->text().arg(tr(PACKAGE_NAME))); ui->lblExplanation2->setText(ui->lblExplanation2->text().arg(PACKAGE_NAME));
uint64_t pruneTarget = std::max<int64_t>(0, gArgs.GetArg("-prune", 0)); uint64_t pruneTarget = std::max<int64_t>(0, gArgs.GetArg("-prune", 0));
requiredSpace = m_blockchain_size; requiredSpace = m_blockchain_size;
@ -146,7 +146,7 @@ Intro::Intro(QWidget *parent, uint64_t blockchain_size, uint64_t chain_state_siz
} }
requiredSpace += m_chain_state_size; requiredSpace += m_chain_state_size;
ui->sizeWarningLabel->setText( ui->sizeWarningLabel->setText(
tr("%1 will download and store a copy of the Dash block chain.").arg(tr(PACKAGE_NAME)) + " " + tr("%1 will download and store a copy of the Dash block chain.").arg(PACKAGE_NAME) + " " +
storageRequiresMsg.arg(requiredSpace) + " " + storageRequiresMsg.arg(requiredSpace) + " " +
tr("The wallet will also be stored in this directory.") tr("The wallet will also be stored in this directory.")
); );
@ -227,7 +227,7 @@ bool Intro::pickDataDirectory(interfaces::Node& node)
} }
break; break;
} catch (const fs::filesystem_error&) { } catch (const fs::filesystem_error&) {
QMessageBox::critical(nullptr, tr(PACKAGE_NAME), QMessageBox::critical(nullptr, PACKAGE_NAME,
tr("Error: Specified data directory \"%1\" cannot be created.").arg(dataDir)); tr("Error: Specified data directory \"%1\" cannot be created.").arg(dataDir));
/* fall through, back to choosing screen */ /* fall through, back to choosing screen */
} }

View File

@ -137,10 +137,10 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
/* Language selector */ /* Language selector */
QDir translations(":translations"); QDir translations(":translations");
ui->bitcoinAtStartup->setToolTip(ui->bitcoinAtStartup->toolTip().arg(tr(PACKAGE_NAME))); ui->bitcoinAtStartup->setToolTip(ui->bitcoinAtStartup->toolTip().arg(PACKAGE_NAME));
ui->bitcoinAtStartup->setText(ui->bitcoinAtStartup->text().arg(tr(PACKAGE_NAME))); ui->bitcoinAtStartup->setText(ui->bitcoinAtStartup->text().arg(PACKAGE_NAME));
ui->lang->setToolTip(ui->lang->toolTip().arg(tr(PACKAGE_NAME))); ui->lang->setToolTip(ui->lang->toolTip().arg(PACKAGE_NAME));
ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant("")); ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
for (const QString &langStr : translations.entryList()) for (const QString &langStr : translations.entryList())
{ {

View File

@ -471,7 +471,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, QWidget* parent, Qt::WindowFlags
QChar nonbreaking_hyphen(8209); QChar nonbreaking_hyphen(8209);
ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir")); ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir"));
ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir")); ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir"));
ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME))); ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(PACKAGE_NAME));
setButtonIcons(); setButtonIcons();
@ -898,7 +898,7 @@ void RPCConsole::clear(bool clearHistory)
QString clsKey = "Ctrl-L"; QString clsKey = "Ctrl-L";
#endif #endif
message(CMD_REPLY, (tr("Welcome to the %1 RPC console.").arg(tr(PACKAGE_NAME)) + "<br>" + message(CMD_REPLY, (tr("Welcome to the %1 RPC console.").arg(PACKAGE_NAME) + "<br>" +
tr("Use up and down arrows to navigate history, and %1 to clear screen.").arg("<b>"+clsKey+"</b>") + "<br>" + tr("Use up and down arrows to navigate history, and %1 to clear screen.").arg("<b>"+clsKey+"</b>") + "<br>" +
tr("Type %1 for an overview of available commands.").arg("<b>help</b>") + "<br>" + tr("Type %1 for an overview of available commands.").arg("<b>help</b>") + "<br>" +
tr("For more information on using this console type %1.").arg("<b>help-console</b>") + tr("For more information on using this console type %1.").arg("<b>help-console</b>") +

View File

@ -51,7 +51,7 @@ SplashScreen::SplashScreen(interfaces::Node& node, Qt::WindowFlags f, const Netw
float scale = qApp->devicePixelRatio(); float scale = qApp->devicePixelRatio();
// define text to place // define text to place
QString titleText = tr(PACKAGE_NAME); QString titleText = PACKAGE_NAME;
QString versionText = QString::fromStdString(FormatFullVersion()).remove(0, 1); QString versionText = QString::fromStdString(FormatFullVersion()).remove(0, 1);
QString titleAddText = networkStyle->getTitleAddText(); QString titleAddText = networkStyle->getTitleAddText();

View File

@ -40,7 +40,7 @@ HelpMessageDialog::HelpMessageDialog(interfaces::Node& node, QWidget *parent, He
GUIUtil::updateFonts(); GUIUtil::updateFonts();
QString version = tr(PACKAGE_NAME) + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()); QString version = QString{PACKAGE_NAME} + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion());
/* On x86 add a bit specifier to the version so that users can distinguish between /* On x86 add a bit specifier to the version so that users can distinguish between
* 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambiguous. * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambiguous.
*/ */
@ -52,7 +52,7 @@ HelpMessageDialog::HelpMessageDialog(interfaces::Node& node, QWidget *parent, He
if (helpMode == about) if (helpMode == about)
{ {
setWindowTitle(tr("About %1").arg(tr(PACKAGE_NAME))); setWindowTitle(tr("About %1").arg(PACKAGE_NAME));
std::string licenseInfo = LicenseInfo(); std::string licenseInfo = LicenseInfo();
/// HTML-format the license message from the core /// HTML-format the license message from the core
@ -195,7 +195,7 @@ ShutdownWindow::ShutdownWindow(interfaces::Node& node, QWidget *parent, Qt::Wind
QVBoxLayout *layout = new QVBoxLayout(); QVBoxLayout *layout = new QVBoxLayout();
layout->addWidget(new QLabel( layout->addWidget(new QLabel(
tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "<br /><br />" + tr("%1 is shutting down...").arg(PACKAGE_NAME) + "<br /><br />" +
tr("Do not shut down the computer until this window disappears."))); tr("Do not shut down the computer until this window disappears.")));
setLayout(layout); setLayout(layout);

View File

@ -100,7 +100,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample)
if (!fMatch) if (!fMatch)
{ {
fDone = true; fDone = true;
std::string strMessage = strprintf(_("Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly."), _(PACKAGE_NAME)); std::string strMessage = strprintf(_("Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly."), PACKAGE_NAME);
SetMiscWarning(strMessage); SetMiscWarning(strMessage);
uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING); uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING);
} }

View File

@ -1304,14 +1304,16 @@ int GetNumCores()
std::string CopyrightHolders(const std::string& strPrefix, unsigned int nStartYear, unsigned int nEndYear) std::string CopyrightHolders(const std::string& strPrefix, unsigned int nStartYear, unsigned int nEndYear)
{ {
std::string strCopyrightHolders = strPrefix + strprintf(" %u-%u ", nStartYear, nEndYear) + strprintf(_(COPYRIGHT_HOLDERS), _(COPYRIGHT_HOLDERS_SUBSTITUTION)); // std::string strCopyrightHolders = strPrefix + strprintf(" %u-%u ", nStartYear, nEndYear) + strprintf(_(COPYRIGHT_HOLDERS), _(COPYRIGHT_HOLDERS_SUBSTITUTION));
const auto copyright_devs = strprintf(_(COPYRIGHT_HOLDERS), COPYRIGHT_HOLDERS_SUBSTITUTION);
std::string strCopyrightHolders = strPrefix + strprintf(" %u-%u ", nStartYear, nEndYear) + copyright_devs;
// Check for untranslated substitution to make sure Dash Core copyright is not removed by accident // Check for untranslated substitution to make sure Dash Core copyright is not removed by accident
if (strprintf(COPYRIGHT_HOLDERS, COPYRIGHT_HOLDERS_SUBSTITUTION).find("Dash Core") == std::string::npos) { if (copyright_devs.find("Dash Core") == std::string::npos) {
strCopyrightHolders += "\n" + strPrefix + strprintf(" %u-%u ", 2014, nEndYear) + "The Dash Core developers"; strCopyrightHolders += "\n" + strPrefix + strprintf(" %u-%u ", 2014, nEndYear) + "The Dash Core developers";
} }
// Check for untranslated substitution to make sure Bitcoin Core copyright is not removed by accident // Check for untranslated substitution to make sure Bitcoin Core copyright is not removed by accident
if (strprintf(COPYRIGHT_HOLDERS, COPYRIGHT_HOLDERS_SUBSTITUTION).find("Bitcoin Core") == std::string::npos) { if (copyright_devs.find("Bitcoin Core") == std::string::npos) {
strCopyrightHolders += "\n" + strPrefix + strprintf(" %u-%u ", 2009, nEndYear) + "The Bitcoin Core developers"; strCopyrightHolders += "\n" + strPrefix + strprintf(" %u-%u ", 2009, nEndYear) + "The Bitcoin Core developers";
} }
return strCopyrightHolders; return strCopyrightHolders;

View File

@ -5036,11 +5036,11 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
walletFile)); walletFile));
} }
else if (nLoadWalletRet == DBErrors::TOO_NEW) { else if (nLoadWalletRet == DBErrors::TOO_NEW) {
return error(strprintf(_("Error loading %s: Wallet requires newer version of %s"), walletFile, _(PACKAGE_NAME))); return error(strprintf(_("Error loading %s: Wallet requires newer version of %s"), walletFile, PACKAGE_NAME));
} }
else if (nLoadWalletRet == DBErrors::NEED_REWRITE) else if (nLoadWalletRet == DBErrors::NEED_REWRITE)
{ {
return error(strprintf(_("Wallet needed to be rewritten: restart %s to complete"), _(PACKAGE_NAME))); return error(strprintf(_("Wallet needed to be rewritten: restart %s to complete"), PACKAGE_NAME));
} }
else { else {
return error(strprintf(_("Error loading %s"), walletFile)); return error(strprintf(_("Error loading %s"), walletFile));

View File

@ -24,8 +24,7 @@ FALSE_POSITIVES = [
("src/stacktraces.cpp", "strprintf(fmtStr, i, si.pc, lstr, fstr)"), ("src/stacktraces.cpp", "strprintf(fmtStr, i, si.pc, lstr, fstr)"),
("src/statsd_client.cpp", "snprintf(d->errmsg, sizeof(d->errmsg), \"could not create socket, err=%m\")"), ("src/statsd_client.cpp", "snprintf(d->errmsg, sizeof(d->errmsg), \"could not create socket, err=%m\")"),
("src/statsd_client.cpp", "snprintf(d->errmsg, sizeof(d->errmsg), \"sendto server fail, host=%s:%d, err=%m\", d->host.c_str(), d->port)"), ("src/statsd_client.cpp", "snprintf(d->errmsg, sizeof(d->errmsg), \"sendto server fail, host=%s:%d, err=%m\", d->host.c_str(), d->port)"),
("src/util/system.cpp", "strprintf(_(COPYRIGHT_HOLDERS), _(COPYRIGHT_HOLDERS_SUBSTITUTION))"), ("src/util/system.cpp", "strprintf(_(COPYRIGHT_HOLDERS), COPYRIGHT_HOLDERS_SUBSTITUTION)"),
("src/util/system.cpp", "strprintf(COPYRIGHT_HOLDERS, COPYRIGHT_HOLDERS_SUBSTITUTION)"),
("src/wallet/wallet.h", "WalletLogPrintf(std::string fmt, Params... parameters)"), ("src/wallet/wallet.h", "WalletLogPrintf(std::string fmt, Params... parameters)"),
("src/wallet/wallet.h", "LogPrintf((\"%s \" + fmt).c_str(), GetDisplayName(), parameters...)"), ("src/wallet/wallet.h", "LogPrintf((\"%s \" + fmt).c_str(), GetDisplayName(), parameters...)"),
("src/logging.h", "LogPrintf(const char* fmt, const Args&... args)"), ("src/logging.h", "LogPrintf(const char* fmt, const Args&... args)"),