Skip to content

Commit 6f6066a

Browse files
committed
WIP: ManipulatorCMD.py: Adding QtCore.QT_TRANSLATE_NOOP()
Starting to add QtCore.QT_TRANSLATE_NOOP(context, text) functions. Haven't tested yet.
1 parent e09eccf commit 6f6066a

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

ManipulatorCMD.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import imp, os, sys, tempfile
1616
import FreeCAD, FreeCADGui
1717
from PySide import QtGui
18+
from PySide.QtCore import QT_TRANSLATE_NOOP
19+
1820
import mvr_locator
1921
# from kicadStepUptools import onLoadBoard, onLoadFootprint
2022

@@ -37,20 +39,20 @@ def reload_lib(lib):
3739

3840
# class SMExtrudeCommandClass():
3941
# """Extrude face"""
40-
#
42+
#
4143
# def GetResources(self):
4244
# return {'Pixmap' : os.path.join( iconPath , 'SMExtrude.svg') , # the name of a svg file available in the resources
43-
# 'MenuText': "Extend Face" ,
44-
# 'ToolTip' : "Extend a face along normal"}
45+
# 'MenuText': QtCore.QT_TRANSLATE_NOOP("Manipulator", "Extend Face"),
46+
# 'ToolTip' : QtCore.QT_TRANSLATE_NOOP("Manipulator", "Extend a face along normal")}
4547

4648
class AlignerTools:
4749
"manipulator tools object"
48-
50+
4951
def GetResources(self):
5052
return {'Pixmap' : os.path.join( ManipulatorWB_icons_path , 'Center-Align.svg') , # the name of a svg file available in the resources
51-
'MenuText': "Aligner Tools" ,
52-
'ToolTip' : "Aligner & Mover Manipulator workbench"}
53-
53+
'MenuText': QtCore.QT_TRANSLATE_NOOP("Manipulator", "Aligner Tools"),
54+
'ToolTip' : QtCore.QT_TRANSLATE_NOOP("Manipulator", "Aligner & Mover Manipulator workbench")}
55+
5456
def IsActive(self):
5557
#if FreeCAD.ActiveDocument == None:
5658
# return False
@@ -74,9 +76,9 @@ class MoverTools:
7476

7577
def GetResources(self):
7678
return {'Pixmap' : os.path.join( ManipulatorWB_icons_path , 'Manipulator-cmd.svg') , # the name of a svg file available in the resources
77-
'MenuText': "Mover Tools" ,
78-
'ToolTip' : "Mover Manipulator workbench"}
79-
79+
'MenuText': QtCore.QT_TRANSLATE_NOOP("Manipulator", "Mover Tools"),
80+
'ToolTip' : QtCore.QT_TRANSLATE_NOOP("Manipulator", "Mover Manipulator workbench")}
81+
8082
def IsActive(self):
8183
#if FreeCAD.ActiveDocument == None:
8284
# return False
@@ -103,9 +105,9 @@ class CaliperTools:
103105

104106
def GetResources(self):
105107
return {'Pixmap' : os.path.join( ManipulatorWB_icons_path , 'Caliper.svg') , # the name of a svg file available in the resources
106-
'MenuText': "Caliper Tools" ,
107-
'ToolTip' : "Caliper Manipulator workbench"}
108-
108+
'MenuText': QtCore.QT_TRANSLATE_NOOP("Manipulator", "Caliper Tools"),
109+
'ToolTip' : QtCore.QT_TRANSLATE_NOOP("Manipulator", "Caliper Manipulator workbench")}
110+
109111
def IsActive(self):
110112
#if FreeCAD.ActiveDocument == None:
111113
# return False
@@ -143,14 +145,14 @@ def GetResources(self):
143145
if 'pdf' in self.ext:
144146
return {'Pixmap' : os.path.join( ManipulatorWB_icons_path , 'datasheet.svg') ,
145147
'MenuText': str(self.exFile),
146-
'ToolTip' : "Help files"}
148+
'ToolTip' : QtCore.QT_TRANSLATE_NOOP("Manipulator", "Help files")}
147149
elif 'fcstd' in self.ext:
148150
return {'Pixmap' : os.path.join( ManipulatorWB_icons_path , 'Freecad.svg') ,
149151
'MenuText': str(self.exFile),
150-
'ToolTip' : "Demo files"}
152+
'ToolTip' : QtCore.QT_TRANSLATE_NOOP("Manipulator", "Demo files")}
151153
else:
152154
return {'MenuText': str(self.exFile),
153-
'ToolTip' : "Demo files"}
155+
'ToolTip' : QtCore.QT_TRANSLATE_NOOP("Manipulator", "Demo files")}
154156

155157
def Activated(self):
156158
FreeCAD.Console.PrintWarning('opening ' + self.exFile + "\r\n")

0 commit comments

Comments
 (0)