Merge pull request #12511 from JosJuice/partial-revert-assembler-translatability

Partially revert "DolphinQt/Assembler: improve translatability"
This commit is contained in:
Tilka
2024-01-20 14:55:03 +00:00
committed by GitHub
2 changed files with 8 additions and 12 deletions

View File

@ -17,10 +17,9 @@ namespace
{ {
QString HtmlFormatErrorLoc(const Common::GekkoAssembler::AssemblerError& err) QString HtmlFormatErrorLoc(const Common::GekkoAssembler::AssemblerError& err)
{ {
const QString error = QStringLiteral("<span style=\"color: red; font-weight: bold\">%1</span>") return QObject::tr("<span style=\"color: red; font-weight: bold\">Error</span> on line %1 col %2")
.arg(QObject::tr("Error")); .arg(err.line + 1)
// i18n: '%1' is the translation of 'Error' .arg(err.col + 1);
return QObject::tr("%1 in column %2").arg(error).arg(err.col + 1);
} }
QString HtmlFormatErrorLine(const Common::GekkoAssembler::AssemblerError& err) QString HtmlFormatErrorLine(const Common::GekkoAssembler::AssemblerError& err)

View File

@ -48,10 +48,9 @@ using namespace Common::GekkoAssembler;
QString HtmlFormatErrorLoc(const AssemblerError& err) QString HtmlFormatErrorLoc(const AssemblerError& err)
{ {
const QString error = QStringLiteral("<span style=\"color: red; font-weight: bold\">%1</span>") return QObject::tr("<span style=\"color: red; font-weight: bold\">Error</span> on line %1 col %2")
.arg(QObject::tr("Error")); .arg(err.line + 1)
// i18n: '%1' is the translation of 'Error' .arg(err.col + 1);
return QObject::tr("%1 on line %1 column %2").arg(error).arg(err.line + 1).arg(err.col + 1);
} }
QString HtmlFormatErrorLine(const AssemblerError& err) QString HtmlFormatErrorLine(const AssemblerError& err)
@ -525,10 +524,8 @@ void AssemblerWidget::OnAssemble(std::vector<CodeBlock>* asm_out)
if (!good) if (!good)
{ {
base_address = 0; base_address = 0;
const QString warning = m_error_box->append(
QStringLiteral("<span style=\"color:#ffcc00\">%1</span>").arg(tr("Warning")); tr("<span style=\"color:#ffcc00\">Warning</span> invalid base address, defaulting to 0"));
// 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(); const std::string contents = active_editor->toPlainText().toStdString();