PD: Add translation to error messages
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user