From 04b9310bb6364ccb334e3e577fe3c2bff18c1134 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 21 Jan 2018 16:25:58 +0100 Subject: [PATCH] Tweak Qt debugger strings to be more translation friendly --- .../Debugger/NewBreakpointDialog.cpp | 23 ++++++++---- .../DolphinQt2/Debugger/RegisterColumn.cpp | 7 +--- .../DolphinQt2/Debugger/RegisterWidget.cpp | 2 + .../Core/DolphinQt2/Debugger/WatchWidget.cpp | 11 ++++-- .../DolphinWX/Debugger/MemoryCheckDlg.cpp | 37 +++++++++---------- 5 files changed, 43 insertions(+), 37 deletions(-) diff --git a/Source/Core/DolphinQt2/Debugger/NewBreakpointDialog.cpp b/Source/Core/DolphinQt2/Debugger/NewBreakpointDialog.cpp index 723ea5d6c9..f288d8f2f5 100644 --- a/Source/Core/DolphinQt2/Debugger/NewBreakpointDialog.cpp +++ b/Source/Core/DolphinQt2/Debugger/NewBreakpointDialog.cpp @@ -48,18 +48,25 @@ void NewBreakpointDialog::CreateWidgets() m_memory_box = new QGroupBox; m_memory_use_address = new QRadioButton(tr("Address")); m_memory_use_address->setChecked(true); + // i18n: A range of memory addresses m_memory_use_range = new QRadioButton(tr("Range")); m_memory_address_from = new QLineEdit; m_memory_address_to = new QLineEdit; m_memory_address_from_label = new QLabel; // Set by OnAddressTypeChanged m_memory_address_to_label = new QLabel(tr("To:")); + // i18n: This is a selectable condition when adding a breakpoint m_memory_on_read = new QRadioButton(tr("Read")); + // i18n: This is a selectable condition when adding a breakpoint m_memory_on_write = new QRadioButton(tr("Write")); + // i18n: This is a selectable condition when adding a breakpoint m_memory_on_read_and_write = new QRadioButton(tr("Read or Write")); m_memory_on_write->setChecked(true); - m_memory_do_log = new QRadioButton(tr("Log")); + // i18n: This is a selectable action when adding a breakpoint + m_memory_do_log = new QRadioButton(tr("Write to Log")); + // i18n: This is a selectable action when adding a breakpoint m_memory_do_break = new QRadioButton(tr("Break")); - m_memory_do_log_and_break = new QRadioButton(tr("Log and Break")); + // i18n: This is a selectable action when adding a breakpoint + m_memory_do_log_and_break = new QRadioButton(tr("Write to Log and Break")); m_memory_do_log_and_break->setChecked(true); auto* memory_layout = new QGridLayout; @@ -70,11 +77,11 @@ void NewBreakpointDialog::CreateWidgets() memory_layout->addWidget(m_memory_address_from, 1, 1); memory_layout->addWidget(m_memory_address_to_label, 1, 2); memory_layout->addWidget(m_memory_address_to, 1, 3); - memory_layout->addWidget(new QLabel(tr("On...")), 2, 0); + memory_layout->addWidget(new QLabel(tr("Condition:")), 2, 0); memory_layout->addWidget(m_memory_on_read, 2, 1); memory_layout->addWidget(m_memory_on_write, 2, 2); memory_layout->addWidget(m_memory_on_read_and_write, 2, 3); - memory_layout->addWidget(new QLabel(tr("Do...")), 3, 0); + memory_layout->addWidget(new QLabel(tr("Action:")), 3, 0); memory_layout->addWidget(m_memory_do_log, 3, 1); memory_layout->addWidget(m_memory_do_break, 3, 2); memory_layout->addWidget(m_memory_do_log_and_break, 3, 3); @@ -123,7 +130,7 @@ void NewBreakpointDialog::OnAddressTypeChanged() void NewBreakpointDialog::accept() { auto invalid_input = [this](QString field) { - QMessageBox::critical(this, tr("Error"), tr("Bad input provided for %1 field").arg(field)); + QMessageBox::critical(this, tr("Error"), tr("Invalid input for the field \"%1\"").arg(field)); }; bool instruction = m_instruction_bp->isChecked(); @@ -145,7 +152,7 @@ void NewBreakpointDialog::accept() if (!good) { - invalid_input(tr("address")); + invalid_input(tr("Address")); return; } @@ -157,7 +164,7 @@ void NewBreakpointDialog::accept() if (!good) { - invalid_input(ranged ? tr("from") : tr("address")); + invalid_input(ranged ? tr("From") : tr("Address")); return; } @@ -166,7 +173,7 @@ void NewBreakpointDialog::accept() u32 to = m_memory_address_to->text().toUInt(&good, 16); if (!good) { - invalid_input(tr("to")); + invalid_input(tr("To")); return; } diff --git a/Source/Core/DolphinQt2/Debugger/RegisterColumn.cpp b/Source/Core/DolphinQt2/Debugger/RegisterColumn.cpp index 5ec0e2597d..3b8810dbbb 100644 --- a/Source/Core/DolphinQt2/Debugger/RegisterColumn.cpp +++ b/Source/Core/DolphinQt2/Debugger/RegisterColumn.cpp @@ -83,14 +83,9 @@ void RegisterColumn::SetValue() } if (!valid) - { - QMessageBox::critical(nullptr, QObject::tr("Invalid input"), - QObject::tr("Bad input for field")); - } + QMessageBox::critical(nullptr, QObject::tr("Error"), QObject::tr("Invalid input provided")); else - { m_set_register(value); - } RefreshValue(); } diff --git a/Source/Core/DolphinQt2/Debugger/RegisterWidget.cpp b/Source/Core/DolphinQt2/Debugger/RegisterWidget.cpp index 53e902cb76..0da6d34c30 100644 --- a/Source/Core/DolphinQt2/Debugger/RegisterWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/RegisterWidget.cpp @@ -130,7 +130,9 @@ void RegisterWidget::ShowContextMenu() auto* view_hex = menu->addAction(tr("Hexadecimal")); auto* view_int = menu->addAction(tr("Signed Integer")); auto* view_uint = menu->addAction(tr("Unsigned Integer")); + // i18n: A floating point number auto* view_float = menu->addAction(tr("Float")); + // i18n: A double precision floating point number auto* view_double = menu->addAction(tr("Double")); for (auto* action : {view_hex, view_int, view_uint, view_float, view_double}) diff --git a/Source/Core/DolphinQt2/Debugger/WatchWidget.cpp b/Source/Core/DolphinQt2/Debugger/WatchWidget.cpp index efdb94d466..96b0132292 100644 --- a/Source/Core/DolphinQt2/Debugger/WatchWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/WatchWidget.cpp @@ -22,6 +22,8 @@ WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent) { + // i18n: This kind of "watch" is used for watching emulated memory. + // It's not related to timekeeping devices. setWindowTitle(tr("Watch")); setAllowedAreas(Qt::AllDockWidgetAreas); @@ -105,8 +107,9 @@ void WatchWidget::Update() m_table->setRowCount(size + 1); - m_table->setHorizontalHeaderLabels( - {tr("Label"), tr("Address"), tr("Hexadecimal"), tr("Decimal"), tr("String")}); + m_table->setHorizontalHeaderLabels({tr("Label"), tr("Address"), tr("Hexadecimal"), tr("Decimal"), + // i18n: Data type used in computing + tr("String")}); for (int i = 0; i < size; i++) { @@ -218,6 +221,8 @@ void WatchWidget::ShowContextMenu() if (row >= 0) { + // i18n: This kind of "watch" is used for watching emulated memory. + // It's not related to timekeeping devices. AddAction(menu, tr("&Delete Watch"), this, [this, row] { DeleteWatch(row); }); AddAction(menu, tr("&Add Memory Breakpoint"), this, [this, row] { AddWatchBreakpoint(row); }); @@ -280,7 +285,7 @@ void WatchWidget::OnItemChanged(QTableWidgetItem* item) } else { - QMessageBox::critical(this, tr("Error"), tr("Bad input provided")); + QMessageBox::critical(this, tr("Error"), tr("Invalid input provided")); } break; } diff --git a/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.cpp b/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.cpp index ac870c8804..084fc855c9 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.cpp +++ b/Source/Core/DolphinWX/Debugger/MemoryCheckDlg.cpp @@ -35,26 +35,23 @@ MemoryCheckDlg::MemoryCheckDlg(wxWindow* parent) m_pEditStartAddress->Disable(); m_pEditEndAddress = new wxTextCtrl(this, wxID_ANY); m_pEditEndAddress->Disable(); - m_radioAddress = new wxRadioButton(this, wxID_ANY, _("With an address"), wxDefaultPosition, + m_radioAddress = new wxRadioButton(this, wxID_ANY, _("With an Address"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); - m_radioRange = new wxRadioButton(this, wxID_ANY, _("Within a range")); - // i18n: This string is used for a radio button that represents the type of - // memory breakpoint that gets triggered when a read operation occurs. - // The string does not mean "read-only" in the sense that something cannot be written to. - m_radioRead = new wxRadioButton(this, wxID_ANY, _("Read only"), wxDefaultPosition, wxDefaultSize, - wxRB_GROUP); - // i18n: This string is used for a radio button that represents the type of - // memory breakpoint that gets triggered when a write operation occurs. - // The string does not mean "write-only" in the sense that something cannot be read from. - m_radioWrite = new wxRadioButton(this, wxID_ANY, _("Write only")); - // i18n: This string is used for a radio button that represents the type of - // memory breakpoint that gets triggered when a read operation or write operation occurs. - // The string is not a command to read and write something or to allow reading and writing. - m_radioReadWrite = new wxRadioButton(this, wxID_ANY, _("Read and write")); - m_radioLog = - new wxRadioButton(this, wxID_ANY, _("Log"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); + m_radioRange = new wxRadioButton(this, wxID_ANY, _("Within a Range")); + m_radioRead = + // i18n: This is a selectable condition when adding a breakpoint + new wxRadioButton(this, wxID_ANY, _("Read"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); + // i18n: This is a selectable condition when adding a breakpoint + m_radioWrite = new wxRadioButton(this, wxID_ANY, _("Write")); + // i18n: This is a selectable condition when adding a breakpoint + m_radioReadWrite = new wxRadioButton(this, wxID_ANY, _("Read or Write")); + // i18n: This is a selectable action when adding a breakpoint + m_radioLog = new wxRadioButton(this, wxID_ANY, _("Write to Log"), wxDefaultPosition, + wxDefaultSize, wxRB_GROUP); + // i18n: This is a selectable action when adding a breakpoint m_radioBreak = new wxRadioButton(this, wxID_ANY, _("Break")); - m_radioBreakLog = new wxRadioButton(this, wxID_ANY, _("Break and log")); + // i18n: This is a selectable action when adding a breakpoint + m_radioBreakLog = new wxRadioButton(this, wxID_ANY, _("Write to Log and Break")); m_radioBreakLog->SetValue(true); auto* sAddressBox = new wxBoxSizer(wxHORIZONTAL); @@ -75,13 +72,13 @@ MemoryCheckDlg::MemoryCheckDlg(wxWindow* parent) sAddressRangeBox->Add(m_pEditEndAddress, 1, wxALIGN_CENTER_VERTICAL); sAddressRangeBox->AddSpacer(space5); - auto* sActions = new wxStaticBoxSizer(wxVERTICAL, this, _("Action")); + auto* sActions = new wxStaticBoxSizer(wxVERTICAL, this, _("Condition")); sActions->Add(m_radioRead, 0, wxEXPAND); sActions->Add(m_radioWrite, 0, wxEXPAND); sActions->Add(m_radioReadWrite, 0, wxEXPAND); m_radioWrite->SetValue(true); - auto* sFlags = new wxStaticBoxSizer(wxVERTICAL, this, _("Flags")); + auto* sFlags = new wxStaticBoxSizer(wxVERTICAL, this, _("Action")); sFlags->Add(m_radioLog); sFlags->Add(m_radioBreak); sFlags->Add(m_radioBreakLog);