From 6cd67e39377565525c92227ecfd76af3bd8cf4b1 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 20 Jan 2024 14:38:04 +0100 Subject: [PATCH] Partially revert "DolphinQt/Assembler: improve translatability" This reverts the parts of commit c8c9928eb1 that made translatability worse rather than better. Changing "Error in column %2" to "%1 in column %2" not only means that the translators have to check the i18n comments to know what word hides behind %1, but there's also the problem that the translator might need to translate "Error" in this context differently from the standalone string "Error". Having to copy-paste some HTML tags may be annoying for translators, but it's a far less serious problem. --- .../Debugger/AssembleInstructionDialog.cpp | 7 +++---- Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp | 13 +++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Source/Core/DolphinQt/Debugger/AssembleInstructionDialog.cpp b/Source/Core/DolphinQt/Debugger/AssembleInstructionDialog.cpp index 01d3c91d5d..a130576e08 100644 --- a/Source/Core/DolphinQt/Debugger/AssembleInstructionDialog.cpp +++ b/Source/Core/DolphinQt/Debugger/AssembleInstructionDialog.cpp @@ -17,10 +17,9 @@ namespace { QString HtmlFormatErrorLoc(const Common::GekkoAssembler::AssemblerError& err) { - 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); + return QObject::tr("Error on line %1 col %2") + .arg(err.line + 1) + .arg(err.col + 1); } QString HtmlFormatErrorLine(const Common::GekkoAssembler::AssemblerError& err) diff --git a/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp b/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp index a769df82e6..a8d2dc96f3 100644 --- a/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp @@ -48,10 +48,9 @@ using namespace Common::GekkoAssembler; QString HtmlFormatErrorLoc(const AssemblerError& err) { - 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); + return QObject::tr("Error on line %1 col %2") + .arg(err.line + 1) + .arg(err.col + 1); } QString HtmlFormatErrorLine(const AssemblerError& err) @@ -525,10 +524,8 @@ void AssemblerWidget::OnAssemble(std::vector* asm_out) if (!good) { base_address = 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)); + m_error_box->append( + tr("Warning invalid base address, defaulting to 0")); } const std::string contents = active_editor->toPlainText().toStdString();