qt: Make RPC console welcome message translation-friendly

This commit is contained in:
Hennadii Stepanov 2021-05-15 14:49:34 +03:00
parent 710c8ba829
commit 0f3d955a38
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

View File

@ -816,23 +816,29 @@ void RPCConsole::clear(bool keep_prompt)
).arg(fixedFontInfo.family(), QString("%1pt").arg(consoleFontSize)) ).arg(fixedFontInfo.family(), QString("%1pt").arg(consoleFontSize))
); );
message(CMD_REPLY, static const QString welcome_message =
tr("Welcome to the %1 RPC console.").arg(PACKAGE_NAME) + /*: RPC console welcome message.
"<br>" + Placeholders %7 and %8 are style tags for the warning content, and
tr("Use up and down arrows to navigate history, and %1 to clear screen.") they are not space separated from the rest of the text intentionally. */
.arg("<b>" + ui->clearButton->shortcut().toString(QKeySequence::NativeText) + "</b>") + tr("Welcome to the %1 RPC console.\n"
"<br>" + "Use up and down arrows to navigate history, and %2 to clear screen.\n"
tr("Use %1 and %2 to increase or decrease the font size.") "Use %3 and %4 to increase or decrease the font size.\n"
.arg("<b>" + ui->fontBiggerButton->shortcut().toString(QKeySequence::NativeText) + "</b>") "Type %5 for an overview of available commands.\n"
.arg("<b>" + ui->fontSmallerButton->shortcut().toString(QKeySequence::NativeText) + "</b>") + "For more information on using this console, type %6.\n"
"<br>" + "\n"
tr("Type %1 for an overview of available commands.").arg("<b>help</b>") + "%7WARNING: Scammers have been active, telling users to type"
"<br>" + " commands here, stealing their wallet contents. Do not use this console"
tr("For more information on using this console type %1.").arg("<b>help-console</b>") + " without fully understanding the ramifications of a command.%8")
"<br><span class=\"secwarning\"><br>" + .arg(PACKAGE_NAME,
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.") + "<b>" + ui->clearButton->shortcut().toString(QKeySequence::NativeText) + "</b>",
"</span>", "<b>" + ui->fontBiggerButton->shortcut().toString(QKeySequence::NativeText) + "</b>",
true); "<b>" + ui->fontSmallerButton->shortcut().toString(QKeySequence::NativeText) + "</b>",
"<b>help</b>",
"<b>help-console</b>",
"<span class=\"secwarning\">",
"<span>");
message(CMD_REPLY, welcome_message, true);
} }
void RPCConsole::keyPressEvent(QKeyEvent *event) void RPCConsole::keyPressEvent(QKeyEvent *event)