PD: Add translation to error messages

This commit is contained in:
Chris Hennes
2023-04-28 11:32:56 -05:00
parent 2ab9abbb01
commit 272a84ca5b
16 changed files with 214 additions and 219 deletions

View File

@@ -91,10 +91,10 @@ Part::Feature* Transformed::getBaseObject(bool silent) const {
if(firstOriginal->isDerivedFrom(Part::Feature::getClassTypeId())) {
rv = static_cast<Part::Feature*>(firstOriginal);
} else {
err = "Transformation feature Linked object is not a Part object";
err = QT_TRANSLATE_NOOP("Exception", "Transformation feature Linked object is not a Part object");
}
} else {
err = "No originals linked to the transformed feature.";
err = QT_TRANSLATE_NOOP("Exception", "No originals linked to the transformed feature.");
}
if (!silent && err) {
@@ -201,7 +201,7 @@ App::DocumentObjectExecReturn *Transformed::execute()
const Part::TopoShape& supportTopShape = supportFeature->Shape.getShape();
if (supportTopShape.getShape().IsNull())
return new App::DocumentObjectExecReturn("Cannot transform invalid support shape");
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Cannot transform invalid support shape"));
// create an untransformed copy of the support shape
Part::TopoShape supportShape(supportTopShape);
@@ -230,7 +230,7 @@ App::DocumentObjectExecReturn *Transformed::execute()
BRepBuilderAPI_Transform mkTrf(shape, *transformIter, false); // No need to copy, now
if (!mkTrf.IsDone()) {
throw Base::CADKernelError("Transformation failed");
throw Base::CADKernelError(QT_TRANSLATE_NOOP("Exception", "Transformation failed"));
}
shape = mkTrf.Shape();
@@ -258,7 +258,7 @@ App::DocumentObjectExecReturn *Transformed::execute()
PartDesign::FeatureAddSub* feature = static_cast<PartDesign::FeatureAddSub*>(*o);
feature->getAddSubShape(fuseShape, cutShape);
if (fuseShape.isNull() && cutShape.isNull())
return new App::DocumentObjectExecReturn("Shape of addsub feature is empty");
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Shape of addsub feature is empty"));
gp_Trsf trsf = feature->getLocation().Transformation().Multiplied(trsfInv);
if (!fuseShape.isNull())
fuseShape = fuseShape.makeTransform(trsf);
@@ -266,7 +266,7 @@ App::DocumentObjectExecReturn *Transformed::execute()
cutShape = cutShape.makeTransform(trsf);
}
else {
return new App::DocumentObjectExecReturn("Only additive and subtractive features can be transformed");
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Only additive and subtractive features can be transformed"));
}
TopoDS_Shape current = support;
@@ -280,9 +280,7 @@ App::DocumentObjectExecReturn *Transformed::execute()
mkBool->SetTools(shapeTools);
mkBool->Build();
if (!mkBool->IsDone()) {
std::stringstream error;
error << "Boolean operation failed";
return new App::DocumentObjectExecReturn(error.str());
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Boolean operation failed"));
}
current = mkBool->Shape();
}
@@ -297,9 +295,7 @@ App::DocumentObjectExecReturn *Transformed::execute()
mkBool->SetTools(shapeTools);
mkBool->Build();
if (!mkBool->IsDone()) {
std::stringstream error;
error << "Boolean operation failed";
return new App::DocumentObjectExecReturn(error.str());
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Boolean operation failed"));
}
current = mkBool->Shape();
}