WInstancesTab: Mark strings as translatable

This commit is contained in:
Lioncash 2020-06-28 07:01:25 -04:00
parent a3bfb3cc7c
commit d6cbc0d247
1 changed files with 16 additions and 16 deletions

View File

@ -50,14 +50,14 @@ WInstancesTab::WInstancesTab(CWorldEditor *pEditor, QWidget *parent) :
connect(ui->TypesTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(OnTreeContextMenu(QPoint)));
// Create context menu
mpHideInstance = new QAction("Hide instance", this);
mpHideType = new QAction("HideType", this);
mpHideAllTypes = new QAction("Hide all types", this);
mpHideAllExceptType = new QAction("HideAllButType", this);
mpHideInstance = new QAction(tr("Hide instance"), this);
mpHideType = new QAction(tr("HideType"), this);
mpHideAllTypes = new QAction(tr("Hide all types"), this);
mpHideAllExceptType = new QAction(tr("HideAllButType"), this);
mpSeparator = new QAction(this);
mpSeparator->setSeparator(true);
mpUnhideAllTypes = new QAction("UnhideAllTypes", this);
mpUnhideAll = new QAction("Unhide all", this);
mpUnhideAllTypes = new QAction(tr("UnhideAllTypes"), this);
mpUnhideAll = new QAction(tr("Unhide all"), this);
QList<QAction*> ActionList;
ActionList << mpHideInstance << mpHideType << mpHideAllTypes << mpHideAllExceptType << mpSeparator
@ -176,8 +176,8 @@ void WInstancesTab::OnTreeContextMenu(QPoint Pos)
// Set visibility and text
if (pObject)
{
QString Hide = mpMenuObject->MarkedVisible() ? "Hide" : "Unhide";
mpHideInstance->setText(QString("%1 instance").arg(Hide));
QString Hide = mpMenuObject->MarkedVisible() ? tr("Hide") : tr("Unhide");
mpHideInstance->setText(tr("%1 instance").arg(Hide));
mpHideInstance->setVisible(true);
}
@ -188,21 +188,21 @@ void WInstancesTab::OnTreeContextMenu(QPoint Pos)
if (mpMenuLayer)
{
QString Hide = mpMenuLayer->IsVisible() ? "Hide" : "Unhide";
mpHideType->setText(QString("%1 layer %2").arg(Hide).arg(TO_QSTRING(mpMenuLayer->Name())));
QString Hide = mpMenuLayer->IsVisible() ? tr("Hide") : tr("Unhide");
mpHideType->setText(tr("%1 layer %2").arg(Hide).arg(TO_QSTRING(mpMenuLayer->Name())));
mpHideType->setVisible(true);
mpHideAllExceptType->setText(QString("Hide all layers but %1").arg(TO_QSTRING(mpMenuLayer->Name())));
mpHideAllExceptType->setText(tr("Hide all layers but %1").arg(TO_QSTRING(mpMenuLayer->Name())));
mpHideAllExceptType->setVisible(true);
}
else if (mpMenuTemplate)
{
QString Hide = mpMenuTemplate->IsVisible() ? "Hide" : "Unhide";
mpHideType->setText(QString("%1 all %2 objects").arg(Hide).arg(TO_QSTRING(mpMenuTemplate->Name())));
QString Hide = mpMenuTemplate->IsVisible() ? tr("Hide") : tr("Unhide");
mpHideType->setText(tr("%1 all %2 objects").arg(Hide).arg(TO_QSTRING(mpMenuTemplate->Name())));
mpHideType->setVisible(true);
mpHideAllExceptType->setText(QString("Hide all types but %1").arg(TO_QSTRING(mpMenuTemplate->Name())));
mpHideAllExceptType->setText(tr("Hide all types but %1").arg(TO_QSTRING(mpMenuTemplate->Name())));
mpHideAllExceptType->setVisible(true);
}
@ -212,8 +212,8 @@ void WInstancesTab::OnTreeContextMenu(QPoint Pos)
mpHideAllExceptType->setVisible(false);
}
mpHideAllTypes->setText(QString("Hide all %1").arg(IsLayers ? "layers" : "types"));
mpUnhideAllTypes->setText(QString("Unhide all %1").arg(IsLayers ? "layers" : "types"));
mpHideAllTypes->setText(tr("Hide all %1").arg(IsLayers ? tr("layers") : tr("types")));
mpUnhideAllTypes->setText(tr("Unhide all %1").arg(IsLayers ? tr("layers") : tr("types")));
QPoint GlobalPos = static_cast<QTreeView*>(sender())->viewport()->mapToGlobal(Pos);
mpTreeContextMenu->exec(GlobalPos);