Skip to content

Commit 8e0abeb

Browse files
hebastoPastaPastaPasta
authored andcommitted
Merge bitcoin-core/gui#345: Connection Type Translator Comments
4832737 qt: connection type translator comments (Jarol Rodriguez) Pull request description: This PR introduces Qt translator comments for `Connection Type` strings in `guiutil.cpp` as well as `rpcconsole.cpp`. This is an alternate implementation of the idea presented in the last three commits of dashpay#289. It is especially inspired by commit 842f4e834dfe5fd2786a5092f78ea28da1b36e4f. Per [Qt Dev Notes](https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Developer-Notes-for-Qt-Code), it is better to not break up strings when not necessary. This way we preserve the full context for translators. ACKs for top commit: jonatack: Code review re-ACK 4832737 per `git diff 371e2b9 4832737`, changes are translator comment edits since my review yesterday (thank you for updating) hebasto: ACK 4832737 Tree-SHA512: 67e1741e10a2e30cde6d50d3293eec89f0b7641b34463865dc6909d2926cdcf33a7d8c1dc8055d2f85906ad2002cdaa594d37b184d16e2f06614b6c5ad00c982
1 parent 688b66e commit 8e0abeb

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/qt/guiutil.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,14 +1673,26 @@ QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction
16731673
{
16741674
QString prefix;
16751675
if (prepend_direction) {
1676-
prefix = (conn_type == ConnectionType::INBOUND) ? QObject::tr("Inbound") : QObject::tr("Outbound") + " ";
1676+
prefix = (conn_type == ConnectionType::INBOUND) ?
1677+
/*: An inbound connection from a peer. An inbound connection
1678+
is a connection initiated by a peer. */
1679+
QObject::tr("Inbound") :
1680+
/*: An outbound connection to a peer. An outbound connection
1681+
is a connection initiated by us. */
1682+
QObject::tr("Outbound") + " ";
16771683
}
16781684
switch (conn_type) {
16791685
case ConnectionType::INBOUND: return prefix;
1686+
//: Peer connection type that relays all network information.
16801687
case ConnectionType::OUTBOUND_FULL_RELAY: return prefix + QObject::tr("Full Relay");
1688+
/*: Peer connection type that relays network information about
1689+
blocks and not transactions or addresses. */
16811690
case ConnectionType::BLOCK_RELAY: return prefix + QObject::tr("Block Relay");
1691+
//: Peer connection type established manually through one of several methods.
16821692
case ConnectionType::MANUAL: return prefix + QObject::tr("Manual");
1693+
//: Short-lived peer connection type that tests the aliveness of known addresses.
16831694
case ConnectionType::FEELER: return prefix + QObject::tr("Feeler");
1695+
//: Short-lived peer connection type that solicits known addresses from a peer.
16841696
case ConnectionType::ADDR_FETCH: return prefix + QObject::tr("Address Fetch");
16851697
} // no default case, so the compiler can warn about missing cases
16861698
assert(false);

src/qt/rpcconsole.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,28 @@ RPCConsole::RPCConsole(interfaces::Node& node, QWidget* parent, Qt::WindowFlags
503503

504504
constexpr QChar nonbreaking_hyphen(8209);
505505
const std::vector<QString> CONNECTION_TYPE_DOC{
506+
//: Explanatory text for an inbound peer connection.
506507
tr("Inbound: initiated by peer"),
508+
/*: Explanatory text for an outbound peer connection that
509+
relays all network information. This is the default behavior for
510+
outbound connections. */
507511
tr("Outbound Full Relay: default"),
512+
/*: Explanatory text for an outbound peer connection that relays
513+
network information about blocks and not transactions or addresses. */
508514
tr("Outbound Block Relay: does not relay transactions or addresses"),
515+
/*: Explanatory text for an outbound peer connection that was
516+
established manually through one of several methods. The numbered
517+
arguments are stand-ins for the methods available to establish
518+
manual connections. */
509519
tr("Outbound Manual: added using RPC %1 or %2/%3 configuration options")
510520
.arg("addnode")
511521
.arg(QString(nonbreaking_hyphen) + "addnode")
512522
.arg(QString(nonbreaking_hyphen) + "connect"),
523+
/*: Explanatory text for a short-lived outbound peer connection that
524+
is used to test the aliveness of known addresses. */
513525
tr("Outbound Feeler: short-lived, for testing addresses"),
526+
/*: Explanatory text for a short-lived outbound peer connection that is used
527+
to request addresses from a peer. */
514528
tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
515529
const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
516530
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));

0 commit comments

Comments
 (0)