Skip to content

Commit ccc4b91

Browse files
committed
Merge bitcoin-core#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 bitcoin-core#289. It is especially inspired by commit 842f4e8. 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
2 parents 33e31f8 + 4832737 commit ccc4b91

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
@@ -673,14 +673,26 @@ QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction
673673
{
674674
QString prefix;
675675
if (prepend_direction) {
676-
prefix = (conn_type == ConnectionType::INBOUND) ? QObject::tr("Inbound") : QObject::tr("Outbound") + " ";
676+
prefix = (conn_type == ConnectionType::INBOUND) ?
677+
/*: An inbound connection from a peer. An inbound connection
678+
is a connection initiated by a peer. */
679+
QObject::tr("Inbound") :
680+
/*: An outbound connection to a peer. An outbound connection
681+
is a connection initiated by us. */
682+
QObject::tr("Outbound") + " ";
677683
}
678684
switch (conn_type) {
679685
case ConnectionType::INBOUND: return prefix;
686+
//: Peer connection type that relays all network information.
680687
case ConnectionType::OUTBOUND_FULL_RELAY: return prefix + QObject::tr("Full Relay");
688+
/*: Peer connection type that relays network information about
689+
blocks and not transactions or addresses. */
681690
case ConnectionType::BLOCK_RELAY: return prefix + QObject::tr("Block Relay");
691+
//: Peer connection type established manually through one of several methods.
682692
case ConnectionType::MANUAL: return prefix + QObject::tr("Manual");
693+
//: Short-lived peer connection type that tests the aliveness of known addresses.
683694
case ConnectionType::FEELER: return prefix + QObject::tr("Feeler");
695+
//: Short-lived peer connection type that solicits known addresses from a peer.
684696
case ConnectionType::ADDR_FETCH: return prefix + QObject::tr("Address Fetch");
685697
} // no default case, so the compiler can warn about missing cases
686698
assert(false);

src/qt/rpcconsole.cpp

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

496496
constexpr QChar nonbreaking_hyphen(8209);
497497
const std::vector<QString> CONNECTION_TYPE_DOC{
498+
//: Explanatory text for an inbound peer connection.
498499
tr("Inbound: initiated by peer"),
500+
/*: Explanatory text for an outbound peer connection that
501+
relays all network information. This is the default behavior for
502+
outbound connections. */
499503
tr("Outbound Full Relay: default"),
504+
/*: Explanatory text for an outbound peer connection that relays
505+
network information about blocks and not transactions or addresses. */
500506
tr("Outbound Block Relay: does not relay transactions or addresses"),
507+
/*: Explanatory text for an outbound peer connection that was
508+
established manually through one of several methods. The numbered
509+
arguments are stand-ins for the methods available to establish
510+
manual connections. */
501511
tr("Outbound Manual: added using RPC %1 or %2/%3 configuration options")
502512
.arg("addnode")
503513
.arg(QString(nonbreaking_hyphen) + "addnode")
504514
.arg(QString(nonbreaking_hyphen) + "connect"),
515+
/*: Explanatory text for a short-lived outbound peer connection that
516+
is used to test the aliveness of known addresses. */
505517
tr("Outbound Feeler: short-lived, for testing addresses"),
518+
/*: Explanatory text for a short-lived outbound peer connection that is used
519+
to request addresses from a peer. */
506520
tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
507521
const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
508522
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));

0 commit comments

Comments
 (0)