i18n: Improve EditSymbolDialog's symbol vs note handling for translators

This commit is contained in:
JosJuice 2025-09-17 19:49:02 +02:00
commit 8c03702b9c
2 changed files with 10 additions and 9 deletions

View file

@ -14,11 +14,10 @@
EditSymbolDialog::EditSymbolDialog(QWidget* parent, const u32 symbol_address, u32* symbol_size, EditSymbolDialog::EditSymbolDialog(QWidget* parent, const u32 symbol_address, u32* symbol_size,
std::string* symbol_name, Type type) std::string* symbol_name, Type type)
: QDialog(parent), m_symbol_name(symbol_name), m_symbol_size(symbol_size), : QDialog(parent), m_type(type), m_symbol_name(symbol_name), m_symbol_size(symbol_size),
m_symbol_address(symbol_address) m_symbol_address(symbol_address)
{ {
m_type = type == Type::Symbol ? tr("Symbol") : tr("Note"); setWindowTitle(m_type == Type::Symbol ? tr("Edit Symbol") : tr("Edit Note"));
setWindowTitle(tr("Edit %1").arg(m_type));
CreateWidgets(); CreateWidgets();
ConnectWidgets(); ConnectWidgets();
} }
@ -29,12 +28,14 @@ void EditSymbolDialog::CreateWidgets()
m_buttons->addButton(tr("Reset"), QDialogButtonBox::ResetRole); m_buttons->addButton(tr("Reset"), QDialogButtonBox::ResetRole);
m_buttons->addButton(tr("Delete"), QDialogButtonBox::DestructiveRole); m_buttons->addButton(tr("Delete"), QDialogButtonBox::DestructiveRole);
QLabel* info_label = new QLabel(tr("Editing %1 starting at: %2\nWarning: Must save the symbol " QLabel* info_label =
"map for changes to be kept.") // i18n: %1 is an address. %2 is a warning message.
.arg(m_type) new QLabel((m_type == Type::Symbol ? tr("Editing symbol starting at: %1\n%2") :
.arg(QString::number(m_symbol_address, 16))); tr("Editing note starting at: %1\n%2"))
.arg(QString::number(m_symbol_address, 16))
.arg(tr("Warning: Must save the symbol map for changes to be kept.")));
m_name_edit = new QLineEdit(); m_name_edit = new QLineEdit();
m_name_edit->setPlaceholderText(tr("%1 name").arg(m_type)); m_name_edit->setPlaceholderText(m_type == Type::Symbol ? tr("Symbol name") : tr("Note name"));
auto* size_layout = new QHBoxLayout; auto* size_layout = new QHBoxLayout;
// i18n: The address where a symbol ends // i18n: The address where a symbol ends

View file

@ -42,7 +42,7 @@ private:
QDialogButtonBox* m_buttons; QDialogButtonBox* m_buttons;
QString m_type; Type m_type;
std::string* m_symbol_name; std::string* m_symbol_name;
u32* m_symbol_size; u32* m_symbol_size;
const u32 m_symbol_address; const u32 m_symbol_address;