diff --git a/Source/Core/DolphinQt/Debugger/AssembleInstructionDialog.cpp b/Source/Core/DolphinQt/Debugger/AssembleInstructionDialog.cpp
index e498dc06e9..01d3c91d5d 100644
--- a/Source/Core/DolphinQt/Debugger/AssembleInstructionDialog.cpp
+++ b/Source/Core/DolphinQt/Debugger/AssembleInstructionDialog.cpp
@@ -17,9 +17,10 @@ namespace
{
QString HtmlFormatErrorLoc(const Common::GekkoAssembler::AssemblerError& err)
{
- return QObject::tr("Error on line %1 col %2")
- .arg(err.line + 1)
- .arg(err.col + 1);
+ const QString error = QStringLiteral("%1")
+ .arg(QObject::tr("Error"));
+ // i18n: '%1' is the translation of 'Error'
+ return QObject::tr("%1 in column %2").arg(error).arg(err.col + 1);
}
QString HtmlFormatErrorLine(const Common::GekkoAssembler::AssemblerError& err)
@@ -31,7 +32,7 @@ QString HtmlFormatErrorLine(const Common::GekkoAssembler::AssemblerError& err)
const QString line_post_error =
QString::fromStdString(std::string(err.error_line.substr(err.col + err.len))).toHtmlEscaped();
- return QObject::tr("%1%2%3")
+ return QStringLiteral("%1%2%3")
.arg(line_pre_error)
.arg(line_error)
.arg(line_post_error);
@@ -61,7 +62,6 @@ void AssembleInstructionDialog::CreateWidgets()
m_error_line_label->setFont(QFont(QFontDatabase::systemFont(QFontDatabase::FixedFont).family()));
m_input_edit->setFont(QFont(QFontDatabase::systemFont(QFontDatabase::FixedFont).family()));
- layout->addWidget(new QLabel(tr("Inline Assembler")));
layout->addWidget(m_error_loc_label);
layout->addWidget(m_input_edit);
layout->addWidget(m_error_line_label);
@@ -102,7 +102,8 @@ void AssembleInstructionDialog::OnEditChanged()
{
m_button_box->button(QDialogButtonBox::Ok)->setEnabled(false);
- m_error_loc_label->setText(tr("Error"));
+ m_error_loc_label->setText(
+ QStringLiteral("%1").arg(tr("Error")));
m_error_line_label->clear();
m_msg_label->setText(tr("No input"));
}
@@ -117,7 +118,8 @@ void AssembleInstructionDialog::OnEditChanged()
m_code = (m_code << 8) | block_bytes[i];
}
- m_error_loc_label->setText(tr("Ok"));
+ m_error_loc_label->setText(
+ QStringLiteral("%1").arg(tr("OK")));
m_error_line_label->clear();
m_msg_label->setText(tr("Instruction: %1").arg(m_code, 8, 16, QLatin1Char('0')));
}
diff --git a/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp b/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp
index bf47a36001..a769df82e6 100644
--- a/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp
@@ -48,9 +48,10 @@ using namespace Common::GekkoAssembler;
QString HtmlFormatErrorLoc(const AssemblerError& err)
{
- return QObject::tr("Error on line %1 col %2")
- .arg(err.line + 1)
- .arg(err.col + 1);
+ const QString error = QStringLiteral("%1")
+ .arg(QObject::tr("Error"));
+ // i18n: '%1' is the translation of 'Error'
+ return QObject::tr("%1 on line %1 column %2").arg(error).arg(err.line + 1).arg(err.col + 1);
}
QString HtmlFormatErrorLine(const AssemblerError& err)
@@ -62,9 +63,9 @@ QString HtmlFormatErrorLine(const AssemblerError& err)
const QString line_post_error =
QString::fromStdString(std::string(err.error_line.substr(err.col + err.len))).toHtmlEscaped();
- return QObject::tr(""
- "%1%2%3
"
- "")
+ return QStringLiteral(""
+ "%1%2%3
"
+ "")
.arg(line_pre_error)
.arg(line_error)
.arg(line_post_error);
@@ -72,7 +73,7 @@ QString HtmlFormatErrorLine(const AssemblerError& err)
QString HtmlFormatMessage(const AssemblerError& err)
{
- return QObject::tr("%1").arg(QString::fromStdString(err.message).toHtmlEscaped());
+ return QStringLiteral("%1").arg(QString::fromStdString(err.message).toHtmlEscaped());
}
void DeserializeBlock(const CodeBlock& blk, std::ostringstream& out_str, bool pad4)
@@ -524,8 +525,10 @@ void AssemblerWidget::OnAssemble(std::vector* asm_out)
if (!good)
{
base_address = 0;
- m_error_box->append(
- tr("Warning invalid base address, defaulting to 0"));
+ const QString warning =
+ QStringLiteral("%1").arg(tr("Warning"));
+ // i18n: '%1' is the translation of 'Warning'
+ m_error_box->append(tr("%1 invalid base address, defaulting to 0").arg(warning));
}
const std::string contents = active_editor->toPlainText().toStdString();