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

@@ -59,14 +59,14 @@ short int FeatureBase::mustExecute() const {
App::DocumentObjectExecReturn* FeatureBase::execute() {
if(!BaseFeature.getValue())
return new App::DocumentObjectExecReturn("BaseFeature link is not set");
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "BaseFeature link is not set"));
if(!BaseFeature.getValue()->isDerivedFrom(Part::Feature::getClassTypeId()))
return new App::DocumentObjectExecReturn("BaseFeature must be a Part::Feature");
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "BaseFeature must be a Part::Feature"));
auto shape = static_cast<Part::Feature*>(BaseFeature.getValue())->Shape.getValue();
if (shape.IsNull())
return new App::DocumentObjectExecReturn("BaseFeature has an empty shape");
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "BaseFeature has an empty shape"));
Shape.setValue(shape);