Tweak Qt debugger strings to be more translation friendly

This commit is contained in:
JosJuice 2018-01-21 16:25:58 +01:00
parent 6a002a4938
commit 04b9310bb6
5 changed files with 43 additions and 37 deletions

View File

@ -48,18 +48,25 @@ void NewBreakpointDialog::CreateWidgets()
m_memory_box = new QGroupBox; m_memory_box = new QGroupBox;
m_memory_use_address = new QRadioButton(tr("Address")); m_memory_use_address = new QRadioButton(tr("Address"));
m_memory_use_address->setChecked(true); m_memory_use_address->setChecked(true);
// i18n: A range of memory addresses
m_memory_use_range = new QRadioButton(tr("Range")); m_memory_use_range = new QRadioButton(tr("Range"));
m_memory_address_from = new QLineEdit; m_memory_address_from = new QLineEdit;
m_memory_address_to = new QLineEdit; m_memory_address_to = new QLineEdit;
m_memory_address_from_label = new QLabel; // Set by OnAddressTypeChanged m_memory_address_from_label = new QLabel; // Set by OnAddressTypeChanged
m_memory_address_to_label = new QLabel(tr("To:")); 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")); 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")); 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_read_and_write = new QRadioButton(tr("Read or Write"));
m_memory_on_write->setChecked(true); 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_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); m_memory_do_log_and_break->setChecked(true);
auto* memory_layout = new QGridLayout; 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_from, 1, 1);
memory_layout->addWidget(m_memory_address_to_label, 1, 2); memory_layout->addWidget(m_memory_address_to_label, 1, 2);
memory_layout->addWidget(m_memory_address_to, 1, 3); 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_read, 2, 1);
memory_layout->addWidget(m_memory_on_write, 2, 2); memory_layout->addWidget(m_memory_on_write, 2, 2);
memory_layout->addWidget(m_memory_on_read_and_write, 2, 3); 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_log, 3, 1);
memory_layout->addWidget(m_memory_do_break, 3, 2); memory_layout->addWidget(m_memory_do_break, 3, 2);
memory_layout->addWidget(m_memory_do_log_and_break, 3, 3); memory_layout->addWidget(m_memory_do_log_and_break, 3, 3);
@ -123,7 +130,7 @@ void NewBreakpointDialog::OnAddressTypeChanged()
void NewBreakpointDialog::accept() void NewBreakpointDialog::accept()
{ {
auto invalid_input = [this](QString field) { 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(); bool instruction = m_instruction_bp->isChecked();
@ -145,7 +152,7 @@ void NewBreakpointDialog::accept()
if (!good) if (!good)
{ {
invalid_input(tr("address")); invalid_input(tr("Address"));
return; return;
} }
@ -157,7 +164,7 @@ void NewBreakpointDialog::accept()
if (!good) if (!good)
{ {
invalid_input(ranged ? tr("from") : tr("address")); invalid_input(ranged ? tr("From") : tr("Address"));
return; return;
} }
@ -166,7 +173,7 @@ void NewBreakpointDialog::accept()
u32 to = m_memory_address_to->text().toUInt(&good, 16); u32 to = m_memory_address_to->text().toUInt(&good, 16);
if (!good) if (!good)
{ {
invalid_input(tr("to")); invalid_input(tr("To"));
return; return;
} }

View File

@ -83,14 +83,9 @@ void RegisterColumn::SetValue()
} }
if (!valid) if (!valid)
{ QMessageBox::critical(nullptr, QObject::tr("Error"), QObject::tr("Invalid input provided"));
QMessageBox::critical(nullptr, QObject::tr("Invalid input"),
QObject::tr("Bad input for field"));
}
else else
{
m_set_register(value); m_set_register(value);
}
RefreshValue(); RefreshValue();
} }

View File

@ -130,7 +130,9 @@ void RegisterWidget::ShowContextMenu()
auto* view_hex = menu->addAction(tr("Hexadecimal")); auto* view_hex = menu->addAction(tr("Hexadecimal"));
auto* view_int = menu->addAction(tr("Signed Integer")); auto* view_int = menu->addAction(tr("Signed Integer"));
auto* view_uint = menu->addAction(tr("Unsigned Integer")); auto* view_uint = menu->addAction(tr("Unsigned Integer"));
// i18n: A floating point number
auto* view_float = menu->addAction(tr("Float")); auto* view_float = menu->addAction(tr("Float"));
// i18n: A double precision floating point number
auto* view_double = menu->addAction(tr("Double")); auto* view_double = menu->addAction(tr("Double"));
for (auto* action : {view_hex, view_int, view_uint, view_float, view_double}) for (auto* action : {view_hex, view_int, view_uint, view_float, view_double})

View File

@ -22,6 +22,8 @@
WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent) 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")); setWindowTitle(tr("Watch"));
setAllowedAreas(Qt::AllDockWidgetAreas); setAllowedAreas(Qt::AllDockWidgetAreas);
@ -105,8 +107,9 @@ void WatchWidget::Update()
m_table->setRowCount(size + 1); m_table->setRowCount(size + 1);
m_table->setHorizontalHeaderLabels( m_table->setHorizontalHeaderLabels({tr("Label"), tr("Address"), tr("Hexadecimal"), tr("Decimal"),
{tr("Label"), tr("Address"), tr("Hexadecimal"), tr("Decimal"), tr("String")}); // i18n: Data type used in computing
tr("String")});
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)
{ {
@ -218,6 +221,8 @@ void WatchWidget::ShowContextMenu()
if (row >= 0) 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("&Delete Watch"), this, [this, row] { DeleteWatch(row); });
AddAction(menu, tr("&Add Memory Breakpoint"), this, AddAction(menu, tr("&Add Memory Breakpoint"), this,
[this, row] { AddWatchBreakpoint(row); }); [this, row] { AddWatchBreakpoint(row); });
@ -280,7 +285,7 @@ void WatchWidget::OnItemChanged(QTableWidgetItem* item)
} }
else else
{ {
QMessageBox::critical(this, tr("Error"), tr("Bad input provided")); QMessageBox::critical(this, tr("Error"), tr("Invalid input provided"));
} }
break; break;
} }

View File

@ -35,26 +35,23 @@ MemoryCheckDlg::MemoryCheckDlg(wxWindow* parent)
m_pEditStartAddress->Disable(); m_pEditStartAddress->Disable();
m_pEditEndAddress = new wxTextCtrl(this, wxID_ANY); m_pEditEndAddress = new wxTextCtrl(this, wxID_ANY);
m_pEditEndAddress->Disable(); 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); wxDefaultSize, wxRB_GROUP);
m_radioRange = new wxRadioButton(this, wxID_ANY, _("Within a range")); m_radioRange = new wxRadioButton(this, wxID_ANY, _("Within a Range"));
// i18n: This string is used for a radio button that represents the type of m_radioRead =
// memory breakpoint that gets triggered when a read operation occurs. // i18n: This is a selectable condition when adding a breakpoint
// The string does not mean "read-only" in the sense that something cannot be written to. new wxRadioButton(this, wxID_ANY, _("Read"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
m_radioRead = new wxRadioButton(this, wxID_ANY, _("Read only"), wxDefaultPosition, wxDefaultSize, // i18n: This is a selectable condition when adding a breakpoint
wxRB_GROUP); m_radioWrite = new wxRadioButton(this, wxID_ANY, _("Write"));
// i18n: This string is used for a radio button that represents the type of // i18n: This is a selectable condition when adding a breakpoint
// memory breakpoint that gets triggered when a write operation occurs. m_radioReadWrite = new wxRadioButton(this, wxID_ANY, _("Read or Write"));
// The string does not mean "write-only" in the sense that something cannot be read from. // i18n: This is a selectable action when adding a breakpoint
m_radioWrite = new wxRadioButton(this, wxID_ANY, _("Write only")); m_radioLog = new wxRadioButton(this, wxID_ANY, _("Write to Log"), wxDefaultPosition,
// i18n: This string is used for a radio button that represents the type of wxDefaultSize, wxRB_GROUP);
// memory breakpoint that gets triggered when a read operation or write operation occurs. // i18n: This is a selectable action when adding a breakpoint
// 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_radioBreak = new wxRadioButton(this, wxID_ANY, _("Break")); 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); m_radioBreakLog->SetValue(true);
auto* sAddressBox = new wxBoxSizer(wxHORIZONTAL); auto* sAddressBox = new wxBoxSizer(wxHORIZONTAL);
@ -75,13 +72,13 @@ MemoryCheckDlg::MemoryCheckDlg(wxWindow* parent)
sAddressRangeBox->Add(m_pEditEndAddress, 1, wxALIGN_CENTER_VERTICAL); sAddressRangeBox->Add(m_pEditEndAddress, 1, wxALIGN_CENTER_VERTICAL);
sAddressRangeBox->AddSpacer(space5); 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_radioRead, 0, wxEXPAND);
sActions->Add(m_radioWrite, 0, wxEXPAND); sActions->Add(m_radioWrite, 0, wxEXPAND);
sActions->Add(m_radioReadWrite, 0, wxEXPAND); sActions->Add(m_radioReadWrite, 0, wxEXPAND);
m_radioWrite->SetValue(true); 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_radioLog);
sFlags->Add(m_radioBreak); sFlags->Add(m_radioBreak);
sFlags->Add(m_radioBreakLog); sFlags->Add(m_radioBreakLog);