From 28ed5dbb3936b5bd9866af8fe19d0fd3128c717b Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Mon, 22 Jan 2024 12:14:54 -0600 Subject: [PATCH] Part: Fix translation bug in FaceMaker --- src/Mod/Part/App/FaceMaker.cpp | 6 +++--- src/Mod/Part/App/FaceMaker.h | 3 ++- src/Mod/Part/App/FaceMakerBullseye.cpp | 4 ++-- src/Mod/Part/App/FaceMakerCheese.cpp | 4 ++-- src/Mod/Part/App/FeatureExtrusion.cpp | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Mod/Part/App/FaceMaker.cpp b/src/Mod/Part/App/FaceMaker.cpp index 31c022ab6c..427ba6116c 100644 --- a/src/Mod/Part/App/FaceMaker.cpp +++ b/src/Mod/Part/App/FaceMaker.cpp @@ -59,7 +59,7 @@ void Part::FaceMaker::addShape(const TopoDS_Shape& sh) this->myWires.push_back(BRepBuilderAPI_MakeWire(TopoDS::Edge(sh)).Wire()); break; default: - throw Base::TypeError("Shape must be a wire, edge or compound. Something else was supplied."); + throw Base::TypeError(tr("Shape must be a wire, edge or compound. Something else was supplied.").toStdString()); break; } this->mySourceShapes.push_back(sh); @@ -172,12 +172,12 @@ TYPESYSTEM_SOURCE(Part::FaceMakerSimple, Part::FaceMakerPublic) std::string Part::FaceMakerSimple::getUserFriendlyName() const { - return {QT_TRANSLATE_NOOP("Part_FaceMaker","Simple")}; + return {tr("Simple").toStdString()}; } std::string Part::FaceMakerSimple::getBriefExplanation() const { - return {QT_TRANSLATE_NOOP("Part_FaceMaker","Makes separate plane face from every wire independently. No support for holes; wires can be on different planes.")}; + return {tr("Makes separate plane face from every wire independently. No support for holes; wires can be on different planes.").toStdString()}; } void Part::FaceMakerSimple::Build_Essence() diff --git a/src/Mod/Part/App/FaceMaker.h b/src/Mod/Part/App/FaceMaker.h index aaf289c2a0..63186d60e6 100644 --- a/src/Mod/Part/App/FaceMaker.h +++ b/src/Mod/Part/App/FaceMaker.h @@ -28,12 +28,12 @@ #include #include #include +#include #include #include #include - namespace Part { @@ -47,6 +47,7 @@ namespace Part */ class PartExport FaceMaker: public BRepBuilderAPI_MakeShape, public Base::BaseClass { + Q_DECLARE_TR_FUNCTIONS(FaceMaker); TYPESYSTEM_HEADER_WITH_OVERRIDE(); public: diff --git a/src/Mod/Part/App/FaceMakerBullseye.cpp b/src/Mod/Part/App/FaceMakerBullseye.cpp index 12959bae39..1937ae69d8 100644 --- a/src/Mod/Part/App/FaceMakerBullseye.cpp +++ b/src/Mod/Part/App/FaceMakerBullseye.cpp @@ -55,12 +55,12 @@ void FaceMakerBullseye::setPlane(const gp_Pln &plane) std::string FaceMakerBullseye::getUserFriendlyName() const { - return {QT_TRANSLATE_NOOP("Part_FaceMaker","Bull's-eye facemaker")}; + return {tr("Bull's-eye facemaker").toStdString()}; } std::string FaceMakerBullseye::getBriefExplanation() const { - return {QT_TRANSLATE_NOOP("Part_FaceMaker","Supports making planar faces with holes with islands.")}; + return {tr("Supports making planar faces with holes with islands.").toStdString()}; } void FaceMakerBullseye::Build_Essence() diff --git a/src/Mod/Part/App/FaceMakerCheese.cpp b/src/Mod/Part/App/FaceMakerCheese.cpp index 0209b75f1e..eb83584eb8 100644 --- a/src/Mod/Part/App/FaceMakerCheese.cpp +++ b/src/Mod/Part/App/FaceMakerCheese.cpp @@ -244,12 +244,12 @@ TopoDS_Shape FaceMakerCheese::makeFace(const std::vector& w) std::string FaceMakerCheese::getUserFriendlyName() const { - return {QT_TRANSLATE_NOOP("Part_FaceMaker","Cheese facemaker")}; + return {tr("Cheese facemaker").toStdString()}; } std::string FaceMakerCheese::getBriefExplanation() const { - return {QT_TRANSLATE_NOOP("Part_FaceMaker","Supports making planar faces with holes, but no islands inside holes.")}; + return {tr("Supports making planar faces with holes, but no islands inside holes.").toStdString()}; } void FaceMakerCheese::Build_Essence() diff --git a/src/Mod/Part/App/FeatureExtrusion.cpp b/src/Mod/Part/App/FeatureExtrusion.cpp index c3fb5ba21f..12e378f3fc 100644 --- a/src/Mod/Part/App/FeatureExtrusion.cpp +++ b/src/Mod/Part/App/FeatureExtrusion.cpp @@ -334,12 +334,12 @@ TYPESYSTEM_SOURCE(Part::FaceMakerExtrusion, Part::FaceMakerCheese) std::string FaceMakerExtrusion::getUserFriendlyName() const { - return {QT_TRANSLATE_NOOP("Part_FaceMaker", "Part Extrude facemaker")}; + return {tr("Part Extrude facemaker").toStdString()}; } std::string FaceMakerExtrusion::getBriefExplanation() const { - return {QT_TRANSLATE_NOOP("Part_FaceMaker", "Supports making faces with holes, does not support nesting.")}; + return {tr("Supports making faces with holes, does not support nesting.").toStdString()}; } #if OCC_VERSION_HEX >= 0x070600