Skip to content

Commit 4882040

Browse files
author
MarcoFalke
committed
Merge bitcoin#16291: gui: Stop translating PACKAGE_NAME
fa64b94 util: No translation of `Bitcoin Core` in the copyright (MarcoFalke) fab8520 qt: Run «make translate» in ./src/ (MarcoFalke) fabe87d scripted-diff: Avoid passing PACKAGE_NAME for translation (MarcoFalke) fa5e9f1 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 fa64b94, I have not tested the code, but I have reviewed it and it looks OK, I agree it can be merged. Tree-SHA512: 626f811531182d0ba0ef1044930d32726773349bcb49b10261288a86ee6b80a183db30a87d817d5b0d501fad058ac22d6272311716b4f5a154f17c6f391a5a1a
2 parents 2679bb8 + fa64b94 commit 4882040

17 files changed

+303
-250
lines changed

share/qt/extract_strings_qt.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ def parse_po(text):
7676
#endif
7777
""")
7878
f.write('static const char UNUSED *bitcoin_strings[] = {\n')
79-
f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),))
8079
f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),))
81-
if os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION') != os.getenv('PACKAGE_NAME'):
82-
f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION'),))
8380
messages.sort(key=operator.itemgetter(0))
8481
for (msgid, msgstr) in messages:
8582
if msgid != EMPTY:

src/Makefile.qt.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ SECONDARY: $(QT_QM)
447447

448448
$(srcdir)/qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_zmq_a_SOURCES) $(libbitcoin_consensus_a_SOURCES) $(libbitcoin_util_a_SOURCES)
449449
@test -n $(XGETTEXT) || echo "xgettext is required for updating translations"
450-
$(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 $^
450+
$(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" $(PYTHON) ../share/qt/extract_strings_qt.py $^
451451

452452
translate: $(srcdir)/qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_BASE_CPP) qt/bitcoin.cpp $(BITCOIN_QT_WINDOWS_CPP) $(BITCOIN_QT_WALLET_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)
453453
@test -n $(LUPDATE) || echo "lupdate is required for updating translations"

src/init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ static bool LockDataDirectory(bool probeOnly)
11851185
return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions."), datadir.string()));
11861186
}
11871187
if (!LockDirectory(datadir, ".lock", probeOnly)) {
1188-
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), datadir.string(), _(PACKAGE_NAME)));
1188+
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), datadir.string(), PACKAGE_NAME));
11891189
}
11901190
return true;
11911191
}
@@ -1203,7 +1203,7 @@ bool AppInitSanityChecks()
12031203

12041204
// Sanity check
12051205
if (!InitSanityCheck())
1206-
return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), _(PACKAGE_NAME)));
1206+
return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), PACKAGE_NAME));
12071207

12081208
// Probe the data directory lock to give an early error message, if possible
12091209
// We cannot hold the data directory lock here, as the forking for daemon() hasn't yet happened,

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ bool CConnman::BindListenPort(const CService &addrBind, std::string& strError, b
20392039
{
20402040
int nErr = WSAGetLastError();
20412041
if (nErr == WSAEADDRINUSE)
2042-
strError = strprintf(_("Unable to bind to %s on this computer. %s is probably already running."), addrBind.ToString(), _(PACKAGE_NAME));
2042+
strError = strprintf(_("Unable to bind to %s on this computer. %s is probably already running."), addrBind.ToString(), PACKAGE_NAME);
20432043
else
20442044
strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %s)"), addrBind.ToString(), NetworkErrorString(nErr));
20452045
LogPrintf("%s\n", strError);

src/qt/bitcoin.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ int GuiMain(int argc, char* argv[])
459459
SetupUIArgs();
460460
std::string error;
461461
if (!node->parseParameters(argc, argv, error)) {
462-
QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME),
462+
QMessageBox::critical(nullptr, PACKAGE_NAME,
463463
QObject::tr("Error parsing command line arguments: %1.").arg(QString::fromStdString(error)));
464464
return EXIT_FAILURE;
465465
}
@@ -496,12 +496,12 @@ int GuiMain(int argc, char* argv[])
496496
/// - Do not call GetDataDir(true) before this step finishes
497497
if (!fs::is_directory(GetDataDir(false)))
498498
{
499-
QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME),
499+
QMessageBox::critical(nullptr, PACKAGE_NAME,
500500
QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(gArgs.GetArg("-datadir", ""))));
501501
return EXIT_FAILURE;
502502
}
503503
if (!node->readConfigFiles(error)) {
504-
QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME),
504+
QMessageBox::critical(nullptr, PACKAGE_NAME,
505505
QObject::tr("Error: Cannot parse configuration file: %1.").arg(QString::fromStdString(error)));
506506
return EXIT_FAILURE;
507507
}
@@ -516,7 +516,7 @@ int GuiMain(int argc, char* argv[])
516516
try {
517517
node->selectParams(gArgs.GetChainName());
518518
} catch(std::exception &e) {
519-
QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME), QObject::tr("Error: %1").arg(e.what()));
519+
QMessageBox::critical(nullptr, PACKAGE_NAME, QObject::tr("Error: %1").arg(e.what()));
520520
return EXIT_FAILURE;
521521
}
522522
#ifdef ENABLE_WALLET
@@ -573,7 +573,7 @@ int GuiMain(int argc, char* argv[])
573573
if (app.baseInitialize()) {
574574
app.requestInitialize();
575575
#if defined(Q_OS_WIN)
576-
WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(QObject::tr(PACKAGE_NAME)), (HWND)app.getMainWinId());
576+
WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(PACKAGE_NAME), (HWND)app.getMainWinId());
577577
#endif
578578
app.exec();
579579
app.requestShutdown();

src/qt/bitcoingui.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ void BitcoinGUI::createActions()
294294
quitAction->setStatusTip(tr("Quit application"));
295295
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
296296
quitAction->setMenuRole(QAction::QuitRole);
297-
aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About %1").arg(tr(PACKAGE_NAME)), this);
298-
aboutAction->setStatusTip(tr("Show information about %1").arg(tr(PACKAGE_NAME)));
297+
aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About %1").arg(PACKAGE_NAME), this);
298+
aboutAction->setStatusTip(tr("Show information about %1").arg(PACKAGE_NAME));
299299
aboutAction->setMenuRole(QAction::AboutRole);
300300
aboutAction->setEnabled(false);
301301
aboutQtAction = new QAction(platformStyle->TextColorIcon(":/icons/about_qt"), tr("About &Qt"), this);
302302
aboutQtAction->setStatusTip(tr("Show information about Qt"));
303303
aboutQtAction->setMenuRole(QAction::AboutQtRole);
304304
optionsAction = new QAction(platformStyle->TextColorIcon(":/icons/options"), tr("&Options..."), this);
305-
optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(tr(PACKAGE_NAME)));
305+
optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(PACKAGE_NAME));
306306
optionsAction->setMenuRole(QAction::PreferencesRole);
307307
optionsAction->setEnabled(false);
308308
toggleHideAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&Show / Hide"), this);
@@ -344,7 +344,7 @@ void BitcoinGUI::createActions()
344344

345345
showHelpMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/info"), tr("&Command-line options"), this);
346346
showHelpMessageAction->setMenuRole(QAction::NoRole);
347-
showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(tr(PACKAGE_NAME)));
347+
showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(PACKAGE_NAME));
348348

349349
connect(quitAction, &QAction::triggered, qApp, QApplication::quit);
350350
connect(aboutAction, &QAction::triggered, this, &BitcoinGUI::aboutClicked);
@@ -728,7 +728,7 @@ void BitcoinGUI::createTrayIcon()
728728
#ifndef Q_OS_MAC
729729
if (QSystemTrayIcon::isSystemTrayAvailable()) {
730730
trayIcon = new QSystemTrayIcon(m_network_style->getTrayAndWindowIcon(), this);
731-
QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + m_network_style->getTitleAddText();
731+
QString toolTip = tr("%1 client").arg(PACKAGE_NAME) + " " + m_network_style->getTitleAddText();
732732
trayIcon->setToolTip(toolTip);
733733
}
734734
#endif
@@ -1291,7 +1291,7 @@ void BitcoinGUI::updateProxyIcon()
12911291

12921292
void BitcoinGUI::updateWindowTitle()
12931293
{
1294-
QString window_title = tr(PACKAGE_NAME);
1294+
QString window_title = PACKAGE_NAME;
12951295
#ifdef ENABLE_WALLET
12961296
if (walletFrame) {
12971297
WalletModel* const wallet_model = walletFrame->currentWalletModel();

src/qt/bitcoinstrings.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
#define UNUSED
1010
#endif
1111
static const char UNUSED *bitcoin_strings[] = {
12-
QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin Core"),
1312
QT_TRANSLATE_NOOP("bitcoin-core", "The %s developers"),
1413
QT_TRANSLATE_NOOP("bitcoin-core", ""
1514
"-maxtxfee is set very high! Fees this large could be paid on a single "
1615
"transaction."),
1716
QT_TRANSLATE_NOOP("bitcoin-core", ""
18-
"Can't generate a change-address key. Private keys are disabled for this "
19-
"wallet."),
17+
"Can't generate a change-address key. No keys in the internal keypool and "
18+
"can't generate any keys."),
2019
QT_TRANSLATE_NOOP("bitcoin-core", ""
2120
"Cannot obtain a lock on data directory %s. %s is probably already running."),
2221
QT_TRANSLATE_NOOP("bitcoin-core", ""
@@ -88,9 +87,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
8887
"Warning: The network does not appear to fully agree! Some miners appear to "
8988
"be experiencing issues."),
9089
QT_TRANSLATE_NOOP("bitcoin-core", ""
91-
"Warning: Unknown block versions being mined! It's possible unknown rules are "
92-
"in effect"),
93-
QT_TRANSLATE_NOOP("bitcoin-core", ""
9490
"Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; "
9591
"if your balance or transactions are incorrect you should restore from a "
9692
"backup."),
@@ -124,15 +120,13 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet %s. Duplicate -wallet fi
124120
QT_TRANSLATE_NOOP("bitcoin-core", "Error opening block database"),
125121
QT_TRANSLATE_NOOP("bitcoin-core", "Error reading from database, shutting down."),
126122
QT_TRANSLATE_NOOP("bitcoin-core", "Error upgrading chainstate database"),
127-
QT_TRANSLATE_NOOP("bitcoin-core", "Error"),
128123
QT_TRANSLATE_NOOP("bitcoin-core", "Error: A fatal internal error occurred, see debug.log for details"),
129124
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low for %s"),
130-
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"),
125+
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is too low!"),
131126
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."),
132127
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to rescan the wallet during initialization"),
133128
QT_TRANSLATE_NOOP("bitcoin-core", "Importing..."),
134129
QT_TRANSLATE_NOOP("bitcoin-core", "Incorrect or no genesis block found. Wrong datadir for network?"),
135-
QT_TRANSLATE_NOOP("bitcoin-core", "Information"),
136130
QT_TRANSLATE_NOOP("bitcoin-core", "Initialization sanity check failed. %s is shutting down."),
137131
QT_TRANSLATE_NOOP("bitcoin-core", "Insufficient funds"),
138132
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -onion address or hostname: '%s'"),
@@ -150,6 +144,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Loading wallet..."),
150144
QT_TRANSLATE_NOOP("bitcoin-core", "Need to specify a port with -whitebind: '%s'"),
151145
QT_TRANSLATE_NOOP("bitcoin-core", "Not enough file descriptors available."),
152146
QT_TRANSLATE_NOOP("bitcoin-core", "Prune cannot be configured with a negative value."),
147+
QT_TRANSLATE_NOOP("bitcoin-core", "Prune mode is incompatible with -blockfilterindex."),
153148
QT_TRANSLATE_NOOP("bitcoin-core", "Prune mode is incompatible with -txindex."),
154149
QT_TRANSLATE_NOOP("bitcoin-core", "Pruning blockstore..."),
155150
QT_TRANSLATE_NOOP("bitcoin-core", "Reducing -maxconnections from %d to %d, because of system limitations."),
@@ -179,19 +174,19 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Transaction too large for fee policy"),
179174
QT_TRANSLATE_NOOP("bitcoin-core", "Transaction too large"),
180175
QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind returned error %s)"),
181176
QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer. %s is probably already running."),
177+
QT_TRANSLATE_NOOP("bitcoin-core", "Unable to create the PID file '%s': %s"),
182178
QT_TRANSLATE_NOOP("bitcoin-core", "Unable to generate initial keys"),
183179
QT_TRANSLATE_NOOP("bitcoin-core", "Unable to generate keys"),
184180
QT_TRANSLATE_NOOP("bitcoin-core", "Unable to start HTTP server. See debug log for details."),
181+
QT_TRANSLATE_NOOP("bitcoin-core", "Unknown -blockfilterindex value %s."),
185182
QT_TRANSLATE_NOOP("bitcoin-core", "Unknown network specified in -onlynet: '%s'"),
186183
QT_TRANSLATE_NOOP("bitcoin-core", "Unsupported logging category %s=%s."),
187184
QT_TRANSLATE_NOOP("bitcoin-core", "Upgrading UTXO database"),
188185
QT_TRANSLATE_NOOP("bitcoin-core", "Upgrading txindex database"),
189186
QT_TRANSLATE_NOOP("bitcoin-core", "User Agent comment (%s) contains unsafe characters."),
190187
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."),
191188
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet(s)..."),
192-
QT_TRANSLATE_NOOP("bitcoin-core", "Wallet %s resides outside wallet directory %s"),
193189
QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart %s to complete"),
194-
QT_TRANSLATE_NOOP("bitcoin-core", "Warning"),
195190
QT_TRANSLATE_NOOP("bitcoin-core", "Warning: unknown new rules activated (versionbit %i)"),
196191
QT_TRANSLATE_NOOP("bitcoin-core", "Zapping all transactions from wallet..."),
197192
};

src/qt/intro.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,16 @@ Intro::Intro(QWidget *parent, uint64_t blockchain_size, uint64_t chain_state_siz
119119
m_chain_state_size(chain_state_size)
120120
{
121121
ui->setupUi(this);
122-
ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(tr(PACKAGE_NAME)));
123-
ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME)));
122+
ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(PACKAGE_NAME));
123+
ui->storageLabel->setText(ui->storageLabel->text().arg(PACKAGE_NAME));
124124

125125
ui->lblExplanation1->setText(ui->lblExplanation1->text()
126-
.arg(tr(PACKAGE_NAME))
126+
.arg(PACKAGE_NAME)
127127
.arg(m_blockchain_size)
128128
.arg(2009)
129129
.arg(tr("Bitcoin"))
130130
);
131-
ui->lblExplanation2->setText(ui->lblExplanation2->text().arg(tr(PACKAGE_NAME)));
131+
ui->lblExplanation2->setText(ui->lblExplanation2->text().arg(PACKAGE_NAME));
132132

133133
uint64_t pruneTarget = std::max<int64_t>(0, gArgs.GetArg("-prune", 0));
134134
requiredSpace = m_blockchain_size;
@@ -145,7 +145,7 @@ Intro::Intro(QWidget *parent, uint64_t blockchain_size, uint64_t chain_state_siz
145145
}
146146
requiredSpace += m_chain_state_size;
147147
ui->sizeWarningLabel->setText(
148-
tr("%1 will download and store a copy of the Bitcoin block chain.").arg(tr(PACKAGE_NAME)) + " " +
148+
tr("%1 will download and store a copy of the Bitcoin block chain.").arg(PACKAGE_NAME) + " " +
149149
storageRequiresMsg.arg(requiredSpace) + " " +
150150
tr("The wallet will also be stored in this directory.")
151151
);
@@ -221,7 +221,7 @@ bool Intro::pickDataDirectory(interfaces::Node& node)
221221
}
222222
break;
223223
} catch (const fs::filesystem_error&) {
224-
QMessageBox::critical(nullptr, tr(PACKAGE_NAME),
224+
QMessageBox::critical(nullptr, PACKAGE_NAME,
225225
tr("Error: Specified data directory \"%1\" cannot be created.").arg(dataDir));
226226
/* fall through, back to choosing screen */
227227
}

0 commit comments

Comments
 (0)