diff --git a/src/Mod/TechDraw/Gui/CommandExtensionDims.cpp b/src/Mod/TechDraw/Gui/CommandExtensionDims.cpp index 7acc78eb8b..c913299791 100644 --- a/src/Mod/TechDraw/Gui/CommandExtensionDims.cpp +++ b/src/Mod/TechDraw/Gui/CommandExtensionDims.cpp @@ -102,7 +102,7 @@ namespace TechDrawGui { void execInsertPrefixChar(Gui::Command* cmd, std::string prefixChar) { // insert a prefix character into the format specifier std::vector selection; - if (!_checkSelection(cmd, selection, "TechDraw Insert Prefix")) { + if (!_checkSelection(cmd, selection, QT_TRANSLATE_NOOP("Command","TechDraw Insert Prefix"))) { return; } @@ -188,7 +188,7 @@ bool CmdTechDrawExtensionInsertSquare::isActive() void execRemovePrefixChar(Gui::Command* cmd) { // remove a prefix character from the format specifier std::vector selection; - if (!_checkSelection(cmd, selection, "TechDraw Remove Prefix")) { + if (!_checkSelection(cmd, selection, QT_TRANSLATE_NOOP("Command","TechDraw Remove Prefix"))) { return; } diff --git a/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp b/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp index ec51706e41..32756ff627 100644 --- a/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp +++ b/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp @@ -94,7 +94,7 @@ void execHoleCircle(Gui::Command* cmd) //create centerlines of a hole/bolt circle std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Hole Circle")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Hole Circle"))) return; const std::vector SubNames = selection[0].getSubNames(); std::vector Circles; @@ -183,7 +183,7 @@ void execCircleCenterLines(Gui::Command* cmd) // create circle centerlines std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Circle Centerlines")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Circle Centerlines"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Circle Centerlines")); double scale = objFeat->getScale(); @@ -360,7 +360,7 @@ void execThreadHoleSide(Gui::Command* cmd) // add cosmetic thread to side view of hole std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Thread Hole Side")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Thread Hole Side"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Cosmetic Thread Hole Side")); const std::vector SubNames = selection[0].getSubNames(); @@ -412,7 +412,7 @@ void execThreadBoltSide(Gui::Command* cmd) // add cosmetic thread to side view of bolt std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Thread Bolt Side")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Thread Bolt Side"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Cosmetic Thread Bolt Side")); const std::vector SubNames = selection[0].getSubNames(); @@ -464,7 +464,7 @@ void execThreadHoleBottom(Gui::Command* cmd) // add cosmetic thread to bottom view of hole std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Thread Hole Bottom")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Thread Hole Bottom"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Cosmetic Thread Hole Bottom")); const std::vector SubNames = selection[0].getSubNames(); @@ -516,7 +516,7 @@ void execThreadBoltBottom(Gui::Command* cmd) // add cosmetic thread to bottom view of bolt std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Thread Bolt Bottom")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Thread Bolt Bottom"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Cosmetic Thread Bolt Bottom")); const std::vector SubNames = selection[0].getSubNames(); @@ -762,7 +762,7 @@ void CmdTechDrawExtensionChangeLineAttributes::activated(int iMsg) Q_UNUSED(iMsg); std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(this, selection, objFeat, "TechDraw Change Line Attributes")) + if (!_checkSel(this, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Change Line Attributes"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Change Line Attributes")); const std::vector subNames = selection[0].getSubNames(); @@ -822,7 +822,7 @@ void CmdTechDrawExtensionVertexAtIntersection::activated(int iMsg) //Base::Console().Message("VertexAtIntersection started\n"); std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(this, selection, objFeat, "TechDraw Cosmetic Intersection Vertex(es)")) + if (!_checkSel(this, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Cosmetic Intersection Vertex(es)"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Cosmetic Intersection Vertex(es)")); const std::vector SubNames = selection[0].getSubNames(); @@ -869,7 +869,7 @@ void execDrawCosmArc(Gui::Command* cmd) //draw a cosmetic arc of circle std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Cosmetic Arc")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Cosmetic Arc"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Cosmetic Arc")); const std::vector SubNames = selection[0].getSubNames(); @@ -934,7 +934,7 @@ void execDrawCosmCircle(Gui::Command* cmd) //draw a cosmetic circle std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Cosmetic Circle")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Cosmetic Circle"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Cosmetic Circle")); const std::vector SubNames = selection[0].getSubNames(); @@ -996,7 +996,7 @@ void execDrawCosmCircle3Points(Gui::Command* cmd) //draw a cosmetic circle through 3 points std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Cosmetic Circle 3 Points")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Cosmetic Circle 3 Points"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Cosmetic Circle 3 Points")); const std::vector SubNames = selection[0].getSubNames(); @@ -1184,7 +1184,7 @@ void execLineParallelPerpendicular(Gui::Command* cmd, bool isParallel) // create a line parallel or perpendicular to another line std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Cosmetic Line Parallel/Perpendicular")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Cosmetic Line Parallel/Perpendicular"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Cosmetic Line Parallel/Perpendicular")); const std::vector SubNames = selection[0].getSubNames(); @@ -1420,7 +1420,7 @@ void CmdTechDrawExtensionLockUnlockView::activated(int iMsg) Q_UNUSED(iMsg); std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(this, selection, objFeat, "TechDraw Lock/Unlock View")) + if (!_checkSel(this, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Lock/Unlock View"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Lock/Unlock View")); if (objFeat->isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) { @@ -1524,7 +1524,7 @@ void execExtendShortenLine(Gui::Command* cmd, bool extend) // extend or shorten a cosmetic line or a centerline std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(cmd, selection, objFeat, "TechDraw Extend/Shorten Line")) + if (!_checkSel(cmd, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw Extend/Shorten Line"))) return; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Extend/Shorten Line")); const std::vector subNames = selection[0].getSubNames(); @@ -1788,7 +1788,7 @@ void CmdTechDrawExtensionAreaAnnotation::activated(int iMsg) Q_UNUSED(iMsg); std::vector selection; TechDraw::DrawViewPart* objFeat; - if (!_checkSel(this, selection, objFeat, "TechDraw calculate selected area")) + if (!_checkSel(this, selection, objFeat, QT_TRANSLATE_NOOP("Command","TechDraw calculate selected area"))) return; double faceArea(0.0), totalArea(0.0), xCenter(0.0), yCenter(0.0); int totalPoints(0); @@ -1953,14 +1953,15 @@ bool _checkSel(Gui::Command* cmd, std::vector& selection, // check selection of getSelectionEx() and selection[0].getObject() selection = cmd->getSelection().getSelectionEx(); if (selection.empty()) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr(message.c_str()), + // message is translated in caller + QMessageBox::warning(Gui::getMainWindow(), QString::fromUtf8(message.c_str()), QObject::tr("Selection is empty")); return false; } objFeat = dynamic_cast(selection[0].getObject()); if (!objFeat) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr(message.c_str()), + QMessageBox::warning(Gui::getMainWindow(), QString::fromUtf8(message.c_str()), QObject::tr("No object selected")); return false; }