Skip to content

Commit 0f3d955

Browse files
committed
qt: Make RPC console welcome message translation-friendly
1 parent 710c8ba commit 0f3d955

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

src/qt/rpcconsole.cpp

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -816,23 +816,29 @@ void RPCConsole::clear(bool keep_prompt)
816816
).arg(fixedFontInfo.family(), QString("%1pt").arg(consoleFontSize))
817817
);
818818

819-
message(CMD_REPLY,
820-
tr("Welcome to the %1 RPC console.").arg(PACKAGE_NAME) +
821-
"<br>" +
822-
tr("Use up and down arrows to navigate history, and %1 to clear screen.")
823-
.arg("<b>" + ui->clearButton->shortcut().toString(QKeySequence::NativeText) + "</b>") +
824-
"<br>" +
825-
tr("Use %1 and %2 to increase or decrease the font size.")
826-
.arg("<b>" + ui->fontBiggerButton->shortcut().toString(QKeySequence::NativeText) + "</b>")
827-
.arg("<b>" + ui->fontSmallerButton->shortcut().toString(QKeySequence::NativeText) + "</b>") +
828-
"<br>" +
829-
tr("Type %1 for an overview of available commands.").arg("<b>help</b>") +
830-
"<br>" +
831-
tr("For more information on using this console type %1.").arg("<b>help-console</b>") +
832-
"<br><span class=\"secwarning\"><br>" +
833-
tr("WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.") +
834-
"</span>",
835-
true);
819+
static const QString welcome_message =
820+
/*: RPC console welcome message.
821+
Placeholders %7 and %8 are style tags for the warning content, and
822+
they are not space separated from the rest of the text intentionally. */
823+
tr("Welcome to the %1 RPC console.\n"
824+
"Use up and down arrows to navigate history, and %2 to clear screen.\n"
825+
"Use %3 and %4 to increase or decrease the font size.\n"
826+
"Type %5 for an overview of available commands.\n"
827+
"For more information on using this console, type %6.\n"
828+
"\n"
829+
"%7WARNING: Scammers have been active, telling users to type"
830+
" commands here, stealing their wallet contents. Do not use this console"
831+
" without fully understanding the ramifications of a command.%8")
832+
.arg(PACKAGE_NAME,
833+
"<b>" + ui->clearButton->shortcut().toString(QKeySequence::NativeText) + "</b>",
834+
"<b>" + ui->fontBiggerButton->shortcut().toString(QKeySequence::NativeText) + "</b>",
835+
"<b>" + ui->fontSmallerButton->shortcut().toString(QKeySequence::NativeText) + "</b>",
836+
"<b>help</b>",
837+
"<b>help-console</b>",
838+
"<span class=\"secwarning\">",
839+
"<span>");
840+
841+
message(CMD_REPLY, welcome_message, true);
836842
}
837843

838844
void RPCConsole::keyPressEvent(QKeyEvent *event)

0 commit comments

Comments
 (0)