CPropertyView: Mark strings as translatable where applicable

This commit is contained in:
Lioncash 2020-06-28 04:58:58 -04:00
parent 34db18aff5
commit 7e44839404

View File

@ -18,23 +18,23 @@ CPropertyView::CPropertyView(QWidget *pParent)
setContextMenuPolicy(Qt::CustomContextMenu); setContextMenuPolicy(Qt::CustomContextMenu);
mpShowNameValidityAction = new QAction("Show whether property name is correct", this); mpShowNameValidityAction = new QAction(tr("Show whether property name is correct"), this);
mpShowNameValidityAction->setCheckable(true); mpShowNameValidityAction->setCheckable(true);
mpShowNameValidityAction->setChecked(false); mpShowNameValidityAction->setChecked(false);
connect(mpShowNameValidityAction, SIGNAL(triggered(bool)), this, SLOT(ToggleShowNameValidity(bool))); connect(mpShowNameValidityAction, SIGNAL(triggered(bool)), this, SLOT(ToggleShowNameValidity(bool)));
if (gTemplatesWritable) if (gTemplatesWritable)
{ {
mpEditTemplateAction = new QAction("Edit template", this); mpEditTemplateAction = new QAction(tr("Edit template"), this);
connect(mpEditTemplateAction, SIGNAL(triggered()), this, SLOT(EditPropertyTemplate())); connect(mpEditTemplateAction, SIGNAL(triggered()), this, SLOT(EditPropertyTemplate()));
} }
else else
{ {
mpEditTemplateAction = new QAction("Template files not writable", this); mpEditTemplateAction = new QAction(tr("Template files not writable"), this);
mpEditTemplateAction->setEnabled(false); mpEditTemplateAction->setEnabled(false);
} }
mpGenNamesForPropertyAction = new QAction("Generate names for this property", this); mpGenNamesForPropertyAction = new QAction(tr("Generate names for this property"), this);
mpGenNamesForSiblingsAction = new QAction(this); // Text set in CreateContextMenu() mpGenNamesForSiblingsAction = new QAction(this); // Text set in CreateContextMenu()
mpGenNamesForChildrenAction = new QAction(this); // Text set in CreateContextMenu() mpGenNamesForChildrenAction = new QAction(this); // Text set in CreateContextMenu()
connect(mpGenNamesForPropertyAction, SIGNAL(triggered(bool)), this, SLOT(GenerateNamesForProperty())); connect(mpGenNamesForPropertyAction, SIGNAL(triggered(bool)), this, SLOT(GenerateNamesForProperty()));
@ -299,14 +299,14 @@ void CPropertyView::CreateContextMenu(const QPoint& rkPos)
if (!pProperty->IsRootParent()) if (!pProperty->IsRootParent())
{ {
QString TypeName = TO_QSTRING( pProperty->Parent()->RootArchetype()->Name() ); QString TypeName = TO_QSTRING( pProperty->Parent()->RootArchetype()->Name() );
mpGenNamesForSiblingsAction->setText( QString("Generate names for %1 properties").arg(TypeName) ); mpGenNamesForSiblingsAction->setText(tr("Generate names for %1 properties").arg(TypeName));
Menu.addAction(mpGenNamesForSiblingsAction); Menu.addAction(mpGenNamesForSiblingsAction);
} }
if (pProperty->Type() == EPropertyType::Struct && !pProperty->IsAtomic()) if (pProperty->Type() == EPropertyType::Struct && !pProperty->IsAtomic())
{ {
QString TypeName = TO_QSTRING( pProperty->RootArchetype()->Name() ); QString TypeName = TO_QSTRING( pProperty->RootArchetype()->Name() );
mpGenNamesForChildrenAction->setText( QString("Generate names for %1 properties").arg(TypeName) ); mpGenNamesForChildrenAction->setText(tr("Generate names for %1 properties").arg(TypeName));
Menu.addAction(mpGenNamesForChildrenAction); Menu.addAction(mpGenNamesForChildrenAction);
} }
} }