Skip to content

Commit 371e2b9

Browse files
committed
qt: connection type translator comments
Introduce Qt translator comments for connection types.
1 parent 5c041cb commit 371e2b9

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
@@ -671,14 +671,26 @@ QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction
671671
{
672672
QString prefix;
673673
if (prepend_direction) {
674-
prefix = (conn_type == ConnectionType::INBOUND) ? QObject::tr("Inbound") : QObject::tr("Outbound") + " ";
674+
prefix = (conn_type == ConnectionType::INBOUND) ?
675+
/*: An inbound connection from a peer. An inbound connection
676+
is a connection initiated by a peer. */
677+
QObject::tr("Inbound") :
678+
/*: An outbound connection to a peer. An outbound connection
679+
is a connection initiated by us. */
680+
QObject::tr("Outbound") + " ";
675681
}
676682
switch (conn_type) {
677683
case ConnectionType::INBOUND: return prefix;
684+
//: Peer connection type that relays all network information.
678685
case ConnectionType::OUTBOUND_FULL_RELAY: return prefix + QObject::tr("Full Relay");
686+
/*: Peer connection type that relays network information about
687+
blocks and not transactions or addresses. */
679688
case ConnectionType::BLOCK_RELAY: return prefix + QObject::tr("Block Relay");
689+
//: Peer connection type established manually through one of several methods.
680690
case ConnectionType::MANUAL: return prefix + QObject::tr("Manual");
691+
//: Peer connection type that verifies or tests known addresses for validity.
681692
case ConnectionType::FEELER: return prefix + QObject::tr("Feeler");
693+
//: Peer connection type that solicits known addresses from a peer.
682694
case ConnectionType::ADDR_FETCH: return prefix + QObject::tr("Address Fetch");
683695
} // no default case, so the compiler can warn about missing cases
684696
assert(false);

src/qt/rpcconsole.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,14 +471,28 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
471471

472472
constexpr QChar nonbreaking_hyphen(8209);
473473
const std::vector<QString> CONNECTION_TYPE_DOC{
474+
//: Explanatory text for an inbound peer connection.
474475
tr("Inbound: initiated by peer"),
476+
/*: Explanatory text for an outbound peer connection that
477+
relays all network information. This is the default behavior for
478+
Outbound connections. */
475479
tr("Outbound Full Relay: default"),
480+
/*: Explanatory text for an outbound peer connection that relays
481+
network information about blocks and not transactions or addresses. */
476482
tr("Outbound Block Relay: does not relay transactions or addresses"),
483+
/*: Explanatory text for an outbound peer connection that was
484+
established manually through one of several methods. The numbered
485+
arguments are stand-ins for the methods available to establish
486+
manual connections. */
477487
tr("Outbound Manual: added using RPC %1 or %2/%3 configuration options")
478488
.arg("addnode")
479489
.arg(QString(nonbreaking_hyphen) + "addnode")
480490
.arg(QString(nonbreaking_hyphen) + "connect"),
491+
/*: Explanatory text for a temporary outbound peer connection that
492+
is used to test the validity of known addresses. */
481493
tr("Outbound Feeler: short-lived, for testing addresses"),
494+
/*: Explanatory text for a temporary outbound peer connection that is used
495+
to request addresses from a peer. */
482496
tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
483497
const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
484498
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));

0 commit comments

Comments
 (0)