From d6cbc0d247590a47dd045dca187f1f78899a8152 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 28 Jun 2020 07:01:25 -0400 Subject: [PATCH] WInstancesTab: Mark strings as translatable --- src/Editor/WorldEditor/WInstancesTab.cpp | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Editor/WorldEditor/WInstancesTab.cpp b/src/Editor/WorldEditor/WInstancesTab.cpp index 53adf608..b945c175 100644 --- a/src/Editor/WorldEditor/WInstancesTab.cpp +++ b/src/Editor/WorldEditor/WInstancesTab.cpp @@ -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 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(sender())->viewport()->mapToGlobal(Pos); mpTreeContextMenu->exec(GlobalPos);