diff --git a/src/Mod/PartDesign/App/FeatureGroove.cpp b/src/Mod/PartDesign/App/FeatureGroove.cpp index 60e079ab78..da2c90b0ee 100644 --- a/src/Mod/PartDesign/App/FeatureGroove.cpp +++ b/src/Mod/PartDesign/App/FeatureGroove.cpp @@ -36,6 +36,7 @@ # include #endif +#include #include #include #include @@ -50,6 +51,8 @@ using namespace PartDesign; namespace PartDesign { +/* TRANSLATOR PartDesign::Groove */ + PROPERTY_SOURCE(PartDesign::Groove, PartDesign::ProfileBased) Groove::Groove() @@ -98,8 +101,13 @@ App::DocumentObjectExecReturn *Groove::execute(void) TopoDS_Shape base; try { base = getBaseShape(); - } catch (const Base::Exception&) { - return new App::DocumentObjectExecReturn("No sketch support and no base shape: Please tell me where to remove the material of the groove!"); + } + catch (const Base::Exception&) { + std::string text(QT_TR_NOOP("The requested feature cannot be created. The reason may be that:\n\n" + " \xe2\x80\xa2 the active Body does not contain a base shape, so there is no\n" + " material to be removed;\n" + " \xe2\x80\xa2 the selected sketch does not belong to the active Body.")); + return new App::DocumentObjectExecReturn(text); } updateAxis(); diff --git a/src/Mod/PartDesign/App/FeatureHole.cpp b/src/Mod/PartDesign/App/FeatureHole.cpp index 3fd2cc64a6..8a3d1d0c94 100644 --- a/src/Mod/PartDesign/App/FeatureHole.cpp +++ b/src/Mod/PartDesign/App/FeatureHole.cpp @@ -51,6 +51,7 @@ # include #endif +#include #include #include #include @@ -62,6 +63,8 @@ using namespace PartDesign; +/* TRANSLATOR PartDesign::Hole */ + const char* Hole::DepthTypeEnums[] = { "Dimension", "ThroughAll", /*, "UpToFirst", */ NULL }; const char* Hole::ThreadTypeEnums[] = { "None", "ISOMetricProfile", "ISOMetricFineProfile", "UNC", "UNF", "UNEF", NULL}; const char* Hole::ThreadFitEnums[] = { "Standard", "Close", NULL}; @@ -948,8 +951,13 @@ App::DocumentObjectExecReturn *Hole::execute(void) TopoDS_Shape base; try { base = getBaseShape(); - } catch (const Base::Exception&) { - return new App::DocumentObjectExecReturn("No sketch support and no base shape: Please tell me where to remove the material of the hole!"); + } + catch (const Base::Exception&) { + std::string text(QT_TR_NOOP("The requested feature cannot be created. The reason may be that:\n\n" + " \xe2\x80\xa2 the active Body does not contain a base shape, so there is no\n" + " material to be removed;\n" + " \xe2\x80\xa2 the selected sketch does not belong to the active Body.")); + return new App::DocumentObjectExecReturn(text); } try { diff --git a/src/Mod/PartDesign/App/FeaturePocket.cpp b/src/Mod/PartDesign/App/FeaturePocket.cpp index c9d49a5878..02d51a3381 100644 --- a/src/Mod/PartDesign/App/FeaturePocket.cpp +++ b/src/Mod/PartDesign/App/FeaturePocket.cpp @@ -43,6 +43,7 @@ # include #endif +#include #include #include #include @@ -53,6 +54,8 @@ using namespace PartDesign; +/* TRANSLATOR PartDesign::Pocket */ + const char* Pocket::TypeEnums[]= {"Length","ThroughAll","UpToFirst","UpToFace","TwoLengths",NULL}; PROPERTY_SOURCE(PartDesign::Pocket, PartDesign::ProfileBased) @@ -113,8 +116,13 @@ App::DocumentObjectExecReturn *Pocket::execute(void) TopoDS_Shape base; try { base = getBaseShape(); - } catch (const Base::Exception&) { - return new App::DocumentObjectExecReturn("No sketch support and no base shape: Please tell me where to remove the material of the pocket!"); + } + catch (const Base::Exception&) { + std::string text(QT_TR_NOOP("The requested feature cannot be created. The reason may be that:\n\n" + " \xe2\x80\xa2 the active Body does not contain a base shape, so there is no\n" + " material to be removed;\n" + " \xe2\x80\xa2 the selected sketch does not belong to the active Body.")); + return new App::DocumentObjectExecReturn(text); } // get the Sketch plane diff --git a/src/Mod/PartDesign/Gui/TaskFeatureParameters.cpp b/src/Mod/PartDesign/Gui/TaskFeatureParameters.cpp index 5080340dd6..9e7b32c276 100644 --- a/src/Mod/PartDesign/Gui/TaskFeatureParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskFeatureParameters.cpp @@ -22,6 +22,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ +#include #include #endif @@ -131,7 +132,12 @@ bool TaskDlgFeatureParameters::accept() { Gui::Command::commitCommand(); } catch (const Base::Exception& e) { // Generally the only thing that should fail is feature->isValid() others should be fine - QMessageBox::warning(Gui::getMainWindow(), tr("Input error"), QString::fromLatin1(e.what())); +#if (QT_VERSION >= 0x050000) + QString errorText = QApplication::translate(feature->getTypeId().getName(), e.what()); +#else + QString errorText = QApplication::translate(feature->getTypeId().getName(), e.what(), 0, QApplication::UnicodeUTF8); +#endif + QMessageBox::warning(Gui::getMainWindow(), tr("Input error"), errorText); return false; }