Skip to content

Commit

Permalink
[PartDesign] Add individual QString for menu text which exposes text …
Browse files Browse the repository at this point in the history
…to translation

Closes FreeCAD/FreeCAD-translations#125
  • Loading branch information
KuzemkoA committed May 3, 2022
1 parent d2253c7 commit 92b3592
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Mod/PartDesign/Gui/TaskDatumParameters.cpp
Expand Up @@ -53,7 +53,7 @@ using namespace Attacher;

TaskDatumParameters::TaskDatumParameters(ViewProviderDatum *ViewProvider,QWidget *parent)
: PartGui::TaskAttacher(ViewProvider, parent, QString::fromLatin1("PartDesign_") + ViewProvider->datumType,
ViewProvider->datumText + tr(" parameters"))
ViewProvider->datumMenuText)
{
Gui::Selection().addSelectionGate(new NoDependentsSelection(ViewProvider->getObject()));
ViewProvider->setPickable(false);
Expand Down
6 changes: 5 additions & 1 deletion src/Mod/PartDesign/Gui/ViewProviderDatum.cpp
Expand Up @@ -107,19 +107,23 @@ void ViewProviderDatum::attach(App::DocumentObject *obj)
App::DocumentObject* o = getObject();
if (o->getTypeId() == PartDesign::Plane::getClassTypeId()) {
datumType = QString::fromLatin1("Plane");
datumText = QObject::tr("Plane");
datumText = QObject::tr("Plane");
datumMenuText = QObject::tr("Datum Plane parameters");
}
else if (o->getTypeId() == PartDesign::Line::getClassTypeId()) {
datumType = QString::fromLatin1("Line");
datumText = QObject::tr("Line");
datumMenuText = QObject::tr("Datum Line parameters");
}
else if (o->getTypeId() == PartDesign::Point::getClassTypeId()) {
datumType = QString::fromLatin1("Point");
datumText = QObject::tr("Point");
datumMenuText = QObject::tr("Datum Point parameters");
}
else if (o->getTypeId() == PartDesign::CoordinateSystem::getClassTypeId()) {
datumType = QString::fromLatin1("CoordinateSystem");
datumText = QObject::tr("Coordinate System");
datumMenuText = QObject::tr("Local Coordinate System parameters");
}

SoShapeHints* hints = new SoShapeHints();
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/PartDesign/Gui/ViewProviderDatum.h
Expand Up @@ -89,7 +89,8 @@ class PartDesignGuiExport ViewProviderDatum : public Gui::ViewProviderGeometryOb
/// The datum type (Plane, Line or Point)
// TODO remove this attribute (2015-09-08, Fat-Zer)
QString datumType;
QString datumText;
QString datumText;
QString datumMenuText;

/**
* Computes appropriate bounding box for the given list of objects to be passed to setExtents ()
Expand Down

0 comments on commit 92b3592

Please sign in to comment.