[TD]fix missing translations

This commit is contained in:
wandererfan
2023-07-01 09:16:26 -04:00
committed by WandererFan
parent b7814c46ad
commit d836baacc2
2 changed files with 20 additions and 19 deletions

View File

@@ -102,7 +102,7 @@ namespace TechDrawGui {
void execInsertPrefixChar(Gui::Command* cmd, std::string prefixChar) {
// insert a prefix character into the format specifier
std::vector<Gui::SelectionObject> 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<Gui::SelectionObject> selection;
if (!_checkSelection(cmd, selection, "TechDraw Remove Prefix")) {
if (!_checkSelection(cmd, selection, QT_TRANSLATE_NOOP("Command","TechDraw Remove Prefix"))) {
return;
}

View File

@@ -94,7 +94,7 @@ void execHoleCircle(Gui::Command* cmd)
//create centerlines of a hole/bolt circle
std::vector<Gui::SelectionObject> 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<std::string> SubNames = selection[0].getSubNames();
std::vector<TechDraw::CirclePtr> Circles;
@@ -183,7 +183,7 @@ void execCircleCenterLines(Gui::Command* cmd)
// create circle centerlines
std::vector<Gui::SelectionObject> 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<Gui::SelectionObject> 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<std::string> SubNames = selection[0].getSubNames();
@@ -412,7 +412,7 @@ void execThreadBoltSide(Gui::Command* cmd)
// add cosmetic thread to side view of bolt
std::vector<Gui::SelectionObject> 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<std::string> SubNames = selection[0].getSubNames();
@@ -464,7 +464,7 @@ void execThreadHoleBottom(Gui::Command* cmd)
// add cosmetic thread to bottom view of hole
std::vector<Gui::SelectionObject> 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<std::string> SubNames = selection[0].getSubNames();
@@ -516,7 +516,7 @@ void execThreadBoltBottom(Gui::Command* cmd)
// add cosmetic thread to bottom view of bolt
std::vector<Gui::SelectionObject> 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<std::string> SubNames = selection[0].getSubNames();
@@ -762,7 +762,7 @@ void CmdTechDrawExtensionChangeLineAttributes::activated(int iMsg)
Q_UNUSED(iMsg);
std::vector<Gui::SelectionObject> 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<std::string> subNames = selection[0].getSubNames();
@@ -822,7 +822,7 @@ void CmdTechDrawExtensionVertexAtIntersection::activated(int iMsg)
//Base::Console().Message("VertexAtIntersection started\n");
std::vector<Gui::SelectionObject> 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<std::string> SubNames = selection[0].getSubNames();
@@ -869,7 +869,7 @@ void execDrawCosmArc(Gui::Command* cmd)
//draw a cosmetic arc of circle
std::vector<Gui::SelectionObject> 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<std::string> SubNames = selection[0].getSubNames();
@@ -934,7 +934,7 @@ void execDrawCosmCircle(Gui::Command* cmd)
//draw a cosmetic circle
std::vector<Gui::SelectionObject> 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<std::string> SubNames = selection[0].getSubNames();
@@ -996,7 +996,7 @@ void execDrawCosmCircle3Points(Gui::Command* cmd)
//draw a cosmetic circle through 3 points
std::vector<Gui::SelectionObject> 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<std::string> 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<Gui::SelectionObject> 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<std::string> SubNames = selection[0].getSubNames();
@@ -1420,7 +1420,7 @@ void CmdTechDrawExtensionLockUnlockView::activated(int iMsg)
Q_UNUSED(iMsg);
std::vector<Gui::SelectionObject> 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<Gui::SelectionObject> 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<std::string> subNames = selection[0].getSubNames();
@@ -1788,7 +1788,7 @@ void CmdTechDrawExtensionAreaAnnotation::activated(int iMsg)
Q_UNUSED(iMsg);
std::vector<Gui::SelectionObject> 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<Gui::SelectionObject>& 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<TechDraw::DrawViewPart*>(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;
}