Draft: Fix translation issues

This commit is contained in:
Roy
2022-01-10 10:17:53 +01:00
parent dede60c481
commit 91f037912e
8 changed files with 28 additions and 44 deletions

View File

@@ -101,30 +101,30 @@ class DraftWorkbench(FreeCADGui.Workbench):
# Set up toolbars
it.init_toolbar(self,
QT_TRANSLATE_NOOP("Draft", "Draft creation tools"),
QT_TRANSLATE_NOOP("Workbench", "Draft creation tools"),
self.drawing_commands)
it.init_toolbar(self,
QT_TRANSLATE_NOOP("Draft", "Draft annotation tools"),
QT_TRANSLATE_NOOP("Workbench", "Draft annotation tools"),
self.annotation_commands)
it.init_toolbar(self,
QT_TRANSLATE_NOOP("Draft", "Draft modification tools"),
QT_TRANSLATE_NOOP("Workbench", "Draft modification tools"),
self.modification_commands)
it.init_toolbar(self,
QT_TRANSLATE_NOOP("Draft", "Draft utility tools"),
QT_TRANSLATE_NOOP("Workbench", "Draft utility tools"),
self.utility_commands_toolbar)
# Set up menus
it.init_menu(self,
[QT_TRANSLATE_NOOP("Draft", "&Drafting")],
[QT_TRANSLATE_NOOP("Workbench", "&Drafting")],
self.drawing_commands)
it.init_menu(self,
[QT_TRANSLATE_NOOP("Draft", "&Annotation")],
[QT_TRANSLATE_NOOP("Workbench", "&Annotation")],
self.annotation_commands)
it.init_menu(self,
[QT_TRANSLATE_NOOP("Draft", "&Modification")],
[QT_TRANSLATE_NOOP("Workbench", "&Modification")],
self.modification_commands)
it.init_menu(self,
[QT_TRANSLATE_NOOP("Draft", "&Utilities")],
[QT_TRANSLATE_NOOP("Workbench", "&Utilities")],
self.utility_commands_menu)
# Set up preferences pages

View File

@@ -73,13 +73,11 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Manage or create annotation styles"
return {'Pixmap': ":icons/Draft_Annotation_Style.svg",
'MenuText': QT_TRANSLATE_NOOP("Draft_AnnotationStyleEditor",
"Annotation styles..."),
'ToolTip': QT_TRANSLATE_NOOP("Draft_AnnotationStyleEditor",
_tip)}
"Manage or create annotation styles")}
def Activated(self):
"""Execute when the command is called.

View File

@@ -61,7 +61,6 @@ class Arc(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
return {'Pixmap': 'Draft_Arc',
'Accel': "A, R",
'MenuText': QT_TRANSLATE_NOOP("Draft_Arc", "Arc"),
@@ -483,15 +482,10 @@ class Arc_3Points(gui_base.GuiCommandSimplest):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Arc by 3 points"
_tip = ("Creates a circular arc by picking 3 points.\n"
"CTRL to snap, SHIFT to constrain.")
d = {'Pixmap': "Draft_Arc_3Points",
'MenuText': QT_TRANSLATE_NOOP("Draft_Arc_3Points", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Arc_3Points", _tip),
'Accel': 'A,T'}
return d
return {'Pixmap': "Draft_Arc_3Points",
'Accel': "A,T"}
'MenuText': QT_TRANSLATE_NOOP("Draft_Arc_3Points", "Arc by 3 points"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Arc_3Points", "Creates a circular arc by picking 3 points.\nCTRL to snap, SHIFT to constrain."),
def Activated(self):
"""Execute when the command is called."""
@@ -556,7 +550,7 @@ class Arc_3Points(gui_base.GuiCommandSimplest):
Gui.Snapper.ui.setTitle(title=translate("draft", "Arc by 3 points"),
icon="Draft_Arc_3Points")
Gui.Snapper.ui.continueCmd.show()
else:
# If three points were already picked in the 3D view
# proceed with creating the final object.
@@ -604,7 +598,6 @@ class ArcGroup:
def GetResources(self):
"""Set icon, menu and tooltip."""
return {'MenuText': QT_TRANSLATE_NOOP("Draft_ArcTools", "Arc tools"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ArcTools", "Create various types of circular arcs.")}

View File

@@ -61,11 +61,9 @@ class CircularArray(gui_base.GuiCommandBase):
def GetResources(self):
"""Set icon, menu and tooltip."""
d = {'Pixmap': 'Draft_CircularArray',
'MenuText': QT_TRANSLATE_NOOP("Draft", "Circular array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates copies of the selected object, and places the copies in a radial pattern\ncreating various circular layers.\n\nThe array can be turned into an orthogonal or a polar array by changing its type.")}
return d
return {'Pixmap': 'Draft_CircularArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_CircularArray", "Circular array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_CircularArray", "Creates copies of the selected object, and places the copies in a radial pattern\ncreating various circular layers.\n\nThe array can be turned into an orthogonal or a polar array by changing its type.")}
def Activated(self):
"""Execute when the command is called.

View File

@@ -59,11 +59,10 @@ class Fillet(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
return {'Pixmap': 'Draft_Fillet',
'Accel':'F,I',
'MenuText': QT_TRANSLATE_NOOP("Draft", "Fillet"),
'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates a fillet between two selected wires or edges.")}
'MenuText': QT_TRANSLATE_NOOP("Draft_Fillet", "Fillet"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Fillet", "Creates a fillet between two selected wires or edges.")}
def Activated(self, name="Fillet"):
"""Execute when the command is called."""

View File

@@ -61,11 +61,9 @@ class OrthoArray(gui_base.GuiCommandBase):
def GetResources(self):
"""Set icon, menu and tooltip."""
d = {'Pixmap': 'Draft_Array',
'MenuText': QT_TRANSLATE_NOOP("Draft", "Array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates copies of the selected object, and places the copies in an orthogonal pattern,\nmeaning the copies follow the specified direction in the X, Y, Z axes.\n\nThe array can be turned into a polar or a circular array by changing its type.")}
return d
return {'Pixmap': 'Draft_Array',
'MenuText': QT_TRANSLATE_NOOP("Draft_Array", "Array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Array", "Creates copies of the selected object, and places the copies in an orthogonal pattern,\nmeaning the copies follow the specified direction in the X, Y, Z axes.\n\nThe array can be turned into a polar or a circular array by changing its type.")}
def Activated(self):
"""Execute when the command is called.

View File

@@ -61,11 +61,9 @@ class PolarArray(gui_base.GuiCommandBase):
def GetResources(self):
"""Set icon, menu and tooltip."""
d = {'Pixmap': 'Draft_PolarArray',
'MenuText': QT_TRANSLATE_NOOP("Draft", "Polar array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates copies of the selected object, and places the copies in a polar pattern\ndefined by a center of rotation and its angle.\n\nThe array can be turned into an orthogonal or a circular array by changing its type.")}
return d
return {'Pixmap': 'Draft_PolarArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_PolarArray", "Polar array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PolarArray", "Creates copies of the selected object, and places the copies in a polar pattern\ndefined by a center of rotation and its angle.\n\nThe array can be turned into an orthogonal or a circular array by changing its type.")}
def Activated(self):
"""Execute when the command is called.

View File

@@ -45,7 +45,7 @@ def get_draft_drawing_commands():
return ["Draft_Line",
"Draft_Wire",
"Draft_Fillet",
([QT_TRANSLATE_NOOP("Draft", "Arc tools")],
([QT_TRANSLATE_NOOP("Workbench", "Arc tools")],
list(arc_group.GetCommands(arc_group))), # tuple len=2: submenu
("Draft_ArcTools", ), # tuple len=1: toolbar flyout
"Draft_Circle",
@@ -53,7 +53,7 @@ def get_draft_drawing_commands():
"Draft_Rectangle",
"Draft_Polygon",
"Draft_BSpline",
([QT_TRANSLATE_NOOP("Draft", "Bezier tools")],
([QT_TRANSLATE_NOOP("Workbench", "Bezier tools")],
list(bez_group.GetCommands(bez_group))),
("Draft_BezierTools", ),
"Draft_Point",
@@ -84,7 +84,7 @@ def get_draft_modification_commands():
"Draft_Stretch",
"Separator",
"Draft_Clone",
([QT_TRANSLATE_NOOP("Draft", "Array tools")],
([QT_TRANSLATE_NOOP("Workbench", "Array tools")],
list(arr_group.GetCommands(arr_group))), # tuple len=2: submenu
("Draft_ArrayTools", ), # tuple len=1: toolbar flyout
"Separator",