Draft: Translate task titles for draft tools (#10227)
This commit is contained in:
@@ -71,7 +71,8 @@ class BezCurve(gui_lines.Line):
|
||||
Activate the specific Bézier curve tracker.
|
||||
"""
|
||||
super(BezCurve, self).Activated(name="BezCurve",
|
||||
icon="Draft_BezCurve")
|
||||
icon="Draft_BezCurve",
|
||||
task_title=translate("draft","Bézier curve"))
|
||||
if self.doc:
|
||||
self.bezcurvetrack = trackers.bezcurveTracker()
|
||||
|
||||
@@ -261,7 +262,8 @@ class CubicBezCurve(gui_lines.Line):
|
||||
param.SetBool("EnableSelection", False)
|
||||
|
||||
super(CubicBezCurve, self).Activated(name="CubicBezCurve",
|
||||
icon="Draft_CubicBezCurve")
|
||||
icon="Draft_CubicBezCurve",
|
||||
task_title=translate("draft","Cubic Bézier curve"))
|
||||
if self.doc:
|
||||
self.bezcurvetrack = trackers.bezcurveTracker()
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class Ellipse(gui_base_original.Creator):
|
||||
super(Ellipse, self).Activated(name="Ellipse")
|
||||
if self.ui:
|
||||
self.refpoint = None
|
||||
self.ui.pointUi(title=translate("draft", self.featureName), icon="Draft_Ellipse")
|
||||
self.ui.pointUi(title=translate("draft", "Ellipse"), icon="Draft_Ellipse")
|
||||
self.ui.extUi()
|
||||
self.call = self.view.addEventCallback("SoEvent", self.action)
|
||||
self.rect = trackers.rectangleTracker()
|
||||
|
||||
@@ -76,7 +76,7 @@ class Fillet(gui_base_original.Creator):
|
||||
tooltip = translate("draft", "Radius of fillet")
|
||||
|
||||
# Call the task panel defined in DraftGui to enter a radius.
|
||||
self.ui.taskUi(title=translate("Draft", self.featureName), icon="Draft_Fillet")
|
||||
self.ui.taskUi(title=translate("Draft", "Fillet"), icon="Draft_Fillet")
|
||||
self.ui.radiusUi()
|
||||
self.ui.sourceCmd = self
|
||||
self.ui.labelRadius.setText(label)
|
||||
|
||||
@@ -63,18 +63,21 @@ class Line(gui_base_original.Creator):
|
||||
'MenuText': QT_TRANSLATE_NOOP("Draft_Line", "Line"),
|
||||
'ToolTip': QT_TRANSLATE_NOOP("Draft_Line", "Creates a 2-point line. CTRL to snap, SHIFT to constrain.")}
|
||||
|
||||
def Activated(self, name="Line", icon="Draft_Line"):
|
||||
def Activated(self, name=QT_TRANSLATE_NOOP("draft","Line"), icon="Draft_Line", task_title=None):
|
||||
"""Execute when the command is called."""
|
||||
super(Line, self).Activated(name)
|
||||
|
||||
if task_title is None:
|
||||
title = translate("draft", name)
|
||||
else:
|
||||
title = task_title
|
||||
if not self.doc:
|
||||
return
|
||||
self.obj = None # stores the temp shape
|
||||
self.oldWP = None # stores the WP if we modify it
|
||||
if self.isWire:
|
||||
self.ui.wireUi(title=translate("draft", self.featureName), icon=icon)
|
||||
self.ui.wireUi(title=title, icon=icon)
|
||||
else:
|
||||
self.ui.lineUi(title=translate("draft", self.featureName), icon=icon)
|
||||
self.ui.lineUi(title=title, icon=icon)
|
||||
|
||||
self.obj = self.doc.addObject("Part::Feature", self.featureName)
|
||||
gui_utils.format_object(self.obj)
|
||||
@@ -360,7 +363,8 @@ class Wire(Line):
|
||||
# then we proceed with the normal line creation functions,
|
||||
# only this time we will be able to input more than two points
|
||||
super(Wire, self).Activated(name="Polyline",
|
||||
icon="Draft_Wire")
|
||||
icon="Draft_Wire",
|
||||
task_title=translate("draft","Polyline"))
|
||||
|
||||
|
||||
Gui.addCommand('Draft_Wire', Wire())
|
||||
|
||||
@@ -66,7 +66,7 @@ class Polygon(gui_base_original.Creator):
|
||||
self.rad = None
|
||||
self.tangents = []
|
||||
self.tanpoints = []
|
||||
self.ui.pointUi(title=translate("draft", self.featureName), icon="Draft_Polygon")
|
||||
self.ui.pointUi(title=translate("draft", "Polygon"), icon="Draft_Polygon")
|
||||
self.ui.extUi()
|
||||
self.ui.isRelative.hide()
|
||||
self.ui.numFaces.show()
|
||||
|
||||
@@ -59,7 +59,7 @@ class Rectangle(gui_base_original.Creator):
|
||||
super(Rectangle, self).Activated(name="Rectangle")
|
||||
if self.ui:
|
||||
self.refpoint = None
|
||||
self.ui.pointUi(title=translate("draft", self.featureName), icon="Draft_Rectangle")
|
||||
self.ui.pointUi(title=translate("draft", "Rectangle"), icon="Draft_Rectangle")
|
||||
self.ui.extUi()
|
||||
if utils.getParam("UsePartPrimitives", False):
|
||||
self.fillstate = self.ui.hasFill.isChecked()
|
||||
|
||||
@@ -65,7 +65,7 @@ class BSpline(gui_lines.Line):
|
||||
|
||||
Activate the specific BSpline tracker.
|
||||
"""
|
||||
super(BSpline, self).Activated(name="Bspline", icon="Draft_BSpline")
|
||||
super(BSpline, self).Activated(name="Bspline", icon="Draft_BSpline", task_title=translate("draft","B-Spline"))
|
||||
if self.doc:
|
||||
self.bsplinetrack = trackers.bsplineTracker()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user