Move HTML out of translated strings

Change-Id: I4664427086619f33e9a882eb3f0a5f2f52e1b42a
Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Robert Loehning
2017-09-13 15:56:47 +02:00
parent 1d763d1941
commit 9e066c7b17
9 changed files with 27 additions and 22 deletions

View File

@@ -1180,7 +1180,7 @@ void PropertiesView::MView::onClassMembersStatusChanged(bool valid)
if (valid)
m_classMembersStatusLabel->clear();
else
m_classMembersStatusLabel->setText(tr("<font color=red>Invalid syntax.</font>"));
m_classMembersStatusLabel->setText("<font color=red>" + tr("Invalid syntax.") + "</font>");
}
void PropertiesView::MView::onParseClassMembers()

View File

@@ -39,9 +39,10 @@ VersionSelector::VersionSelector(const QString &fileName, const QString &message
{
ui->setupUi(this);
ui->headerLabel->setText(ui->headerLabel->text().arg(fileName));
ui->loadedText->setHtml(tr("<html><head/><body><p><b>Note: You will not be able to check in "
"this file without merging the changes (not supported by the "
"plugin)</b></p></body></html>"));
ui->loadedText->setHtml("<html><head/><body><p><b>"
+ tr("Note: You will not be able to check in this file without merging "
"the changes (not supported by the plugin)")
+ "</b></p></body></html>");
m_stream = new QTextStream(message.toLocal8Bit(), QIODevice::ReadOnly | QIODevice::Text);
QString line;
while (!m_stream->atEnd() && !line.contains(QLatin1String("1) Loaded version")))

View File

@@ -450,9 +450,9 @@ KitInformation::ItemList CMakeGeneratorKitInformation::toUserOutput(const Kit *k
} else {
message = tr("Generator: %1<br>Extra generator: %2").arg(info.generator).arg(info.extraGenerator);
if (!info.platform.isEmpty())
message += tr("<br>Platform: %1").arg(info.platform);
message += "<br/>" + tr("Platform: %1").arg(info.platform);
if (!info.toolset.isEmpty())
message += tr("<br>Toolset: %1").arg(info.toolset);
message += "<br/>" + tr("Toolset: %1").arg(info.toolset);
}
return ItemList() << qMakePair(tr("CMake Generator"), message);
}

View File

@@ -115,7 +115,7 @@ void CMakeTargetNode::setTargetInformation(const QList<Utils::FileName> &artifac
m_tooltip += QCoreApplication::translate("CMakeTargetNode", "No build artifacts");
} else {
const QStringList tmp = Utils::transform(artifacts, &Utils::FileName::toUserOutput);
m_tooltip += QCoreApplication::translate("CMakeTargetNode", "Build artifacts:<br>")
m_tooltip += QCoreApplication::translate("CMakeTargetNode", "Build artifacts:") + "<br>"
+ tmp.join("<br>");
}
}

View File

@@ -286,7 +286,8 @@ void KdePasteProtocol::paste(const QString &text, Protocol::ContentType ct, int
QString details = tr("Pasting to KDE paster needs authentication.<br/>"
"Enter your KDE Identity credentials to continue.");
if (m_loginFailed)
details.prepend(tr("<span style='background-color:LightYellow;color:red'>Login failed</span><br/><br/>"));
details.prepend("<span style='background-color:LightYellow;color:red'>"
+ tr("Login failed") + "</span><br/><br/>");
AuthenticationDialog authDialog(details, Core::ICore::dialogParent());
authDialog.setWindowTitle("Authenticate for KDE paster");

View File

@@ -447,9 +447,9 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
m_labelUseFullPath->setToolTip(pathToolTip);
const QString moduleToolTip =
tr("<p>Specifying the module (base name of the library or executable) "
"<p>" + tr("Specifying the module (base name of the library or executable) "
"for function or file type breakpoints can significantly speed up "
"debugger startup times (CDB, LLDB).");
"debugger startup times (CDB, LLDB).") + "</p>";
m_lineEditModule = new QLineEdit(groupBoxAdvanced);
m_lineEditModule->setToolTip(moduleToolTip);
m_labelModule = new QLabel(tr("&Module:"), groupBoxAdvanced);
@@ -457,8 +457,8 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
m_labelModule->setToolTip(moduleToolTip);
const QString commandsToolTip =
tr("<p>Debugger commands to be executed when the breakpoint is hit. "
"This feature is only available for GDB.");
"<p>" + tr("Debugger commands to be executed when the breakpoint is hit. "
"This feature is only available for GDB.") + "</p>";
m_textEditCommands = new SmallTextEdit(groupBoxAdvanced);
m_textEditCommands->setToolTip(commandsToolTip);
m_labelCommands = new QLabel(tr("&Commands:"), groupBoxAdvanced);

View File

@@ -320,10 +320,11 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
auto groupBoxCustomDumperCommands = new QGroupBox(debuggingHelperGroupBox);
groupBoxCustomDumperCommands->setTitle(tr("Debugging Helper Customization"));
groupBoxCustomDumperCommands->setToolTip(tr(
"<html><head/><body><p>Python commands entered here will be executed after built-in "
"debugging helpers have been loaded and fully initialized. You can load additional "
"debugging helpers or modify existing ones here.</p></body></html>"));
groupBoxCustomDumperCommands->setToolTip("<html><head/><body><p>"
+ tr("Python commands entered here will be executed after built-in "
"debugging helpers have been loaded and fully initialized. You can "
"load additional debugging helpers or modify existing ones here.")
+ "</p></body></html>");
auto textEditCustomDumperCommands = new QTextEdit(groupBoxCustomDumperCommands);
textEditCustomDumperCommands->setAcceptRichText(false);

View File

@@ -401,10 +401,11 @@ void DebuggerItemConfigWidget::load(const DebuggerItem *item)
const bool is64bit = is64BitWindowsSystem();
const QString versionString = is64bit ? tr("64-bit version") : tr("32-bit version");
//: Label text for path configuration. %2 is "x-bit version".
text = tr("<html><body><p>Specify the path to the "
text = "<html><body><p>"
+ tr("Specify the path to the "
"<a href=\"%1\">Windows Console Debugger executable</a>"
" (%2) here.</p>""</body></html>").
arg(QLatin1String(debuggingToolsWikiLinkC), versionString);
" (%2) here.").arg(QLatin1String(debuggingToolsWikiLinkC), versionString)
+ "</p></body></html>";
versionCommand = QLatin1String("-version");
} else {
versionCommand = QLatin1String("--version");

View File

@@ -218,7 +218,8 @@ void ActionHandler::createActions()
registerCommand(Constants::ACTION_ADD_CANVAS_DIAGRAM, nullptr, Core::Context(), true, tr("Add Canvas Diagram"));
d->synchronizeBrowserAction = registerCommand(
Constants::ACTION_SYNC_BROWSER, nullptr, Core::Context(), true,
tr("Synchronize Browser and Diagram<br><i><small>Press&Hold for options</small></i>"))->action();
tr("Synchronize Browser and Diagram") + "<br><i><small>"
+ tr("Press && Hold for options") + "</small></i>")->action();
d->synchronizeBrowserAction->setIcon(Utils::Icons::LINK.icon());
d->synchronizeBrowserAction->setCheckable(true);