scripted-diff: Avoid passing PACKAGE_NAME for translation

-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/\<\w+(::\w+)?\(PACKAGE_NAME\)/PACKAGE_NAME/g' $(git grep -l --extended-regexp '\<\w+(::\w+)?\(PACKAGE_NAME\)' src)
-END VERIFY SCRIPT-
This commit is contained in:
MarcoFalke 2019-06-26 10:28:13 -04:00
parent fa5e9f157e
commit fabe87d2c9
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
11 changed files with 32 additions and 32 deletions

View file

@ -1179,7 +1179,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;
} }
@ -1197,7 +1197,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

@ -2039,7 +2039,7 @@ bool CConnman::BindListenPort(const CService &addrBind, std::string& strError, b
{ {
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

@ -460,7 +460,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;
} }
@ -497,12 +497,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;
} }
@ -517,7 +517,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
@ -574,7 +574,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

@ -294,15 +294,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(platformStyle->TextColorIcon(":/icons/about"), tr("&About %1").arg(tr(PACKAGE_NAME)), this); aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About %1").arg(PACKAGE_NAME), this);
aboutAction->setStatusTip(tr("Show information about %1").arg(tr(PACKAGE_NAME))); 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(platformStyle->TextColorIcon(":/icons/about_qt"), tr("About &Qt"), this); aboutQtAction = new QAction(platformStyle->TextColorIcon(":/icons/about_qt"), 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(platformStyle->TextColorIcon(":/icons/options"), tr("&Options..."), this); optionsAction = new QAction(platformStyle->TextColorIcon(":/icons/options"), 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(platformStyle->TextColorIcon(":/icons/about"), tr("&Show / Hide"), this); toggleHideAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&Show / Hide"), this);
@ -344,7 +344,7 @@ void BitcoinGUI::createActions()
showHelpMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/info"), tr("&Command-line options"), this); showHelpMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/info"), 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 Bitcoin command-line options").arg(tr(PACKAGE_NAME))); showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(PACKAGE_NAME));
connect(quitAction, &QAction::triggered, qApp, QApplication::quit); connect(quitAction, &QAction::triggered, qApp, QApplication::quit);
connect(aboutAction, &QAction::triggered, this, &BitcoinGUI::aboutClicked); connect(aboutAction, &QAction::triggered, this, &BitcoinGUI::aboutClicked);
@ -729,7 +729,7 @@ void BitcoinGUI::createTrayIcon()
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
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);
} }
#endif #endif
@ -1292,7 +1292,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

@ -119,16 +119,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(2009) .arg(2009)
.arg(tr("Bitcoin")) .arg(tr("Bitcoin"))
); );
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;
@ -145,7 +145,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 Bitcoin block chain.").arg(tr(PACKAGE_NAME)) + " " + tr("%1 will download and store a copy of the Bitcoin 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.")
); );
@ -221,7 +221,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

@ -87,12 +87,12 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
/* Display elements init */ /* Display elements init */
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->openBitcoinConfButton->setToolTip(ui->openBitcoinConfButton->toolTip().arg(tr(PACKAGE_NAME))); ui->openBitcoinConfButton->setToolTip(ui->openBitcoinConfButton->toolTip().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

@ -457,7 +457,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
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));
if (platformStyle->getImagesOnButtons()) { if (platformStyle->getImagesOnButtons()) {
ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export")); ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export"));
@ -804,7 +804,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

@ -39,7 +39,7 @@ SplashScreen::SplashScreen(interfaces::Node& node, Qt::WindowFlags f, const Netw
devicePixelRatio = static_cast<QGuiApplication*>(QCoreApplication::instance())->devicePixelRatio(); devicePixelRatio = static_cast<QGuiApplication*>(QCoreApplication::instance())->devicePixelRatio();
// define text to place // define text to place
QString titleText = tr(PACKAGE_NAME); QString titleText = PACKAGE_NAME;
QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion()));
QString copyrightText = QString::fromUtf8(CopyrightHolders(strprintf("\xc2\xA9 %u-%u ", 2009, COPYRIGHT_YEAR)).c_str()); QString copyrightText = QString::fromUtf8(CopyrightHolders(strprintf("\xc2\xA9 %u-%u ", 2009, COPYRIGHT_YEAR)).c_str());
QString titleAddText = networkStyle->getTitleAddText(); QString titleAddText = networkStyle->getTitleAddText();

View file

@ -48,7 +48,7 @@ HelpMessageDialog::HelpMessageDialog(interfaces::Node& node, QWidget *parent, bo
if (about) if (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
@ -150,7 +150,7 @@ ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f):
{ {
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

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