From 0f3d955a38fe59a4e8cc4bf9f4442e6e1fd8bcbb Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 15 May 2021 14:49:34 +0300 Subject: qt: Make RPC console welcome message translation-friendly --- src/qt/rpcconsole.cpp | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index afbdc07ba0..14fa7e96db 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -816,23 +816,29 @@ void RPCConsole::clear(bool keep_prompt) ).arg(fixedFontInfo.family(), QString("%1pt").arg(consoleFontSize)) ); - message(CMD_REPLY, - tr("Welcome to the %1 RPC console.").arg(PACKAGE_NAME) + - "
" + - tr("Use up and down arrows to navigate history, and %1 to clear screen.") - .arg("" + ui->clearButton->shortcut().toString(QKeySequence::NativeText) + "") + - "
" + - tr("Use %1 and %2 to increase or decrease the font size.") - .arg("" + ui->fontBiggerButton->shortcut().toString(QKeySequence::NativeText) + "") - .arg("" + ui->fontSmallerButton->shortcut().toString(QKeySequence::NativeText) + "") + - "
" + - tr("Type %1 for an overview of available commands.").arg("help") + - "
" + - tr("For more information on using this console type %1.").arg("help-console") + - "

" + - 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.") + - "
", - true); + static const QString welcome_message = + /*: RPC console welcome message. + Placeholders %7 and %8 are style tags for the warning content, and + they are not space separated from the rest of the text intentionally. */ + tr("Welcome to the %1 RPC console.\n" + "Use up and down arrows to navigate history, and %2 to clear screen.\n" + "Use %3 and %4 to increase or decrease the font size.\n" + "Type %5 for an overview of available commands.\n" + "For more information on using this console, type %6.\n" + "\n" + "%7WARNING: 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.%8") + .arg(PACKAGE_NAME, + "" + ui->clearButton->shortcut().toString(QKeySequence::NativeText) + "", + "" + ui->fontBiggerButton->shortcut().toString(QKeySequence::NativeText) + "", + "" + ui->fontSmallerButton->shortcut().toString(QKeySequence::NativeText) + "", + "help", + "help-console", + "", + ""); + + message(CMD_REPLY, welcome_message, true); } void RPCConsole::keyPressEvent(QKeyEvent *event) -- cgit v1.2.3