From 23b01e425fdcca16970a42eb369b5dee26b253c0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 24 May 2016 18:16:02 +0200 Subject: [PATCH] + make sure strings in PartDesign & Sketcher commands can be translated --- src/Mod/PartDesign/Gui/CommandBody.cpp | 8 ++++---- src/Mod/Sketcher/Gui/Command.cpp | 28 +++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Mod/PartDesign/Gui/CommandBody.cpp b/src/Mod/PartDesign/Gui/CommandBody.cpp index c6bac0b2d..fe28d6c7b 100644 --- a/src/Mod/PartDesign/Gui/CommandBody.cpp +++ b/src/Mod/PartDesign/Gui/CommandBody.cpp @@ -596,8 +596,8 @@ void CmdPartDesignMoveFeature::activated(int iMsg) for (std::vector::iterator it = bodies.begin(); it != bodies.end(); ++it) items.push_back(QString::fromUtf8((*it)->Label.getValue())); QString text = QInputDialog::getItem(Gui::getMainWindow(), - qApp->translate(className(), "Select body"), - qApp->translate(className(), "Select a body from the list"), + qApp->translate("PartDesign_MoveFeature", "Select body"), + qApp->translate("PartDesign_MoveFeature", "Select a body from the list"), items, 0, false, &ok); if (!ok) return; int index = items.indexOf(text); @@ -729,8 +729,8 @@ void CmdPartDesignMoveFeatureInTree::activated(int iMsg) } QString text = QInputDialog::getItem(Gui::getMainWindow(), - qApp->translate(className(), "Select feature"), - qApp->translate(className(), "Select a feature from the list"), + qApp->translate("PartDesign_MoveFeatureInTree", "Select feature"), + qApp->translate("PartDesign_MoveFeatureInTree", "Select a feature from the list"), items, 0, false, &ok); if (!ok) return; int index = items.indexOf(text); diff --git a/src/Mod/Sketcher/Gui/Command.cpp b/src/Mod/Sketcher/Gui/Command.cpp index c88399751..740861407 100644 --- a/src/Mod/Sketcher/Gui/Command.cpp +++ b/src/Mod/Sketcher/Gui/Command.cpp @@ -174,8 +174,8 @@ void CmdSketcherNewSketch::activated(int iMsg) iSugg = items.size()-1; } QString text = QInputDialog::getItem(Gui::getMainWindow(), - qApp->translate(className(), "Sketch attachment"), - qApp->translate(className(), "Select the method to attach this sketch to selected object"), + qApp->translate("Sketcher_NewSketch", "Sketch attachment"), + qApp->translate("Sketcher_NewSketch", "Select the method to attach this sketch to selected object"), items, iSugg, false, &ok); if (!ok) return; int index = items.indexOf(text); @@ -457,8 +457,8 @@ void CmdSketcherMapSketch::activated(int iMsg) std::vector sketches = doc->getObjectsOfType(Part::Part2DObject::getClassTypeId()); if (sketches.empty()) { QMessageBox::warning(Gui::getMainWindow(), - qApp->translate(className(), "No sketch found"), - qApp->translate(className(), "The document doesn't have a sketch")); + qApp->translate("Sketcher_MapSketch", "No sketch found"), + qApp->translate("Sketcher_MapSketch", "The document doesn't have a sketch")); return; } @@ -467,8 +467,8 @@ void CmdSketcherMapSketch::activated(int iMsg) for (std::vector::iterator it = sketches.begin(); it != sketches.end(); ++it) items.push_back(QString::fromUtf8((*it)->Label.getValue())); QString text = QInputDialog::getItem(Gui::getMainWindow(), - qApp->translate(className(), "Select sketch"), - qApp->translate(className(), "Select a sketch from the list"), + qApp->translate("Sketcher_MapSketch", "Select sketch"), + qApp->translate("Sketcher_MapSketch", "Select a sketch from the list"), items, 0, false, &ok); if (!ok) return; int index = items.indexOf(text); @@ -521,26 +521,26 @@ void CmdSketcherMapSketch::activated(int iMsg) if (validModes[i] == curMapMode) { iCurr = items.size() - 1; items.back().append(bCurIncompatible? - qApp->translate(className()," (incompatible with selection)") + qApp->translate("Sketcher_MapSketch"," (incompatible with selection)") : - qApp->translate(className()," (current)") ); + qApp->translate("Sketcher_MapSketch"," (current)") ); } if (validModes[i] == suggMapMode){ iSugg = items.size() - 1; if(iSugg == 1){ iSugg = 0;//redirect deactivate to detach } else { - items.back().append(qApp->translate(className()," (suggested)")); + items.back().append(qApp->translate("Sketcher_MapSketch"," (suggested)")); } } } // * execute the dialog text = QInputDialog::getItem(Gui::getMainWindow() - ,qApp->translate(className(), "Sketch attachment") + ,qApp->translate("Sketcher_MapSketch", "Sketch attachment") ,bCurIncompatible? - qApp->translate(className(), "Current attachment mode is incompatible with the new selection. Select the method to attach this sketch to selected objects.") + qApp->translate("Sketcher_MapSketch", "Current attachment mode is incompatible with the new selection. Select the method to attach this sketch to selected objects.") : - qApp->translate(className(), "Select the method to attach this sketch to selected objects.") + qApp->translate("Sketcher_MapSketch", "Select the method to attach this sketch to selected objects.") ,items , bCurIncompatible ? iSugg : iCurr , false @@ -575,8 +575,8 @@ void CmdSketcherMapSketch::activated(int iMsg) } } catch (ExceptionWrongInput &e) { QMessageBox::warning(Gui::getMainWindow(), - qApp->translate(className(), "Map sketch"), - qApp->translate(className(), "Can't map a sketch to support:\n" + qApp->translate("Sketcher_MapSketch", "Map sketch"), + qApp->translate("Sketcher_MapSketch", "Can't map a sketch to support:\n" "%1").arg(e.ErrMsg.length() ? e.ErrMsg : msg_str)); } }