diff --git a/src/Mod/Path/PathScripts/PathSurface.py b/src/Mod/Path/PathScripts/PathSurface.py index 6a16a8c0fa..1b39e936da 100644 --- a/src/Mod/Path/PathScripts/PathSurface.py +++ b/src/Mod/Path/PathScripts/PathSurface.py @@ -30,13 +30,14 @@ __doc__ = "Class and implementation of 3D Surface operation." __contributors__ = "russ4262 (Russell Johnson)" import FreeCAD -from PySide import QtCore + +translate = FreeCAD.Qt.translate # OCL must be installed try: import ocl except ImportError: - msg = QtCore.QCoreApplication.translate( + msg = translate( "PathSurface", "This operation requires OpenCamLib to be installed." ) FreeCAD.Console.PrintError(msg + "\n") @@ -62,8 +63,6 @@ if FreeCAD.GuiUp: import FreeCADGui -translate = FreeCAD.Qt.translate - if False: PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) PathLog.trackModule(PathLog.thisModule()) @@ -112,12 +111,6 @@ class ObjectSurface(PathOp.ObjectOp): for n in self.propertyEnumerations(): setattr(obj, n[0], n[1]) - # if warn: - # newPropMsg = translate("PathSurface", "New property added to") - # newPropMsg += ' "{}": {}'.format(obj.Label, self.addNewProps) + ". " - # newPropMsg += translate("PathSurface", "Check default value(s).") - # FreeCAD.Console.PrintWarning(newPropMsg + "\n") - self.propertiesReady = True def opPropertyDefinitions(self): diff --git a/src/Mod/Path/PathScripts/PathToolBitGui.py b/src/Mod/Path/PathScripts/PathToolBitGui.py index bedb532070..14c877c756 100644 --- a/src/Mod/Path/PathScripts/PathToolBitGui.py +++ b/src/Mod/Path/PathScripts/PathToolBitGui.py @@ -200,7 +200,7 @@ def GetNewToolFile(parent=None): if foo and foo[0]: if not isValidFileName(foo[0]): msgBox = QtGui.QMessageBox() - msg = translate("Path", "Invalid Filename", None) + msg = translate("Path", "Invalid Filename") msgBox.setText(msg) msgBox.exec_() else: diff --git a/src/Mod/Path/PathScripts/PathToolBitLibraryGui.py b/src/Mod/Path/PathScripts/PathToolBitLibraryGui.py index 0ab4308b21..84d0ff7ad9 100644 --- a/src/Mod/Path/PathScripts/PathToolBitLibraryGui.py +++ b/src/Mod/Path/PathScripts/PathToolBitLibraryGui.py @@ -79,9 +79,7 @@ def checkWorkingDir(): if ret == qm.No: return False - msg = translate( - "Path_ToolBit", "Choose a writable location for your toolbits", None - ) + msg = translate("Path_ToolBit", "Choose a writable location for your toolbits") while not dirOK(): workingdir = PySide.QtGui.QFileDialog.getExistingDirectory( None, msg, PathPreferences.filePath() @@ -665,7 +663,7 @@ class ToolBitLibrary(object): filename = PySide.QtGui.QFileDialog.getSaveFileName( self.form, - translate("Path_ToolBit", "Save toolbit library", None), + translate("Path_ToolBit", "Save toolbit library"), PathPreferences.lastPathToolLibrary(), "{}".format(TooltableTypeJSON), ) @@ -794,7 +792,7 @@ class ToolBitLibrary(object): filename = PySide.QtGui.QFileDialog.getSaveFileName( self.form, - translate("Path_ToolBit", "Save toolbit library", None), + translate("Path_ToolBit", "Save toolbit library"), PathPreferences.lastPathToolLibrary(), "{};;{}".format(TooltableTypeJSON, TooltableTypeLinuxCNC), ) diff --git a/src/Mod/Path/PathScripts/PathToolLibraryEditor.py b/src/Mod/Path/PathScripts/PathToolLibraryEditor.py index 5294b1d54e..77b1157829 100644 --- a/src/Mod/Path/PathScripts/PathToolLibraryEditor.py +++ b/src/Mod/Path/PathScripts/PathToolLibraryEditor.py @@ -188,7 +188,7 @@ class EditorPanel: """imports a tooltable from a file""" filename = QtGui.QFileDialog.getOpenFileName( self.form, - translate("Path_ToolTable", "Open tooltable", None), + translate("Path_ToolTable", "Open tooltable"), None, "{};;{};;{}".format( self.TLM.TooltableTypeJSON, @@ -205,7 +205,7 @@ class EditorPanel: """export a tooltable to a file""" filename = QtGui.QFileDialog.getSaveFileName( self.form, - translate("Path_ToolTable", "Save tooltable", None), + translate("Path_ToolTable", "Save tooltable"), None, "{};;{};;{}".format( self.TLM.TooltableTypeJSON, diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index 63e42f3330..9b7cb4ff4c 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -426,7 +426,7 @@ def addToJob(obj, jobname=None): if len(jobs) == 1: job = jobs[0] else: - PathLog.error(translate("Path", "Didn't find job %s") % jobname) + PathLog.error(translate("Path", "Didn't find job {}".format(jobname))) return None else: jobs = GetJobs() diff --git a/src/Mod/Path/PathScripts/PathWaterline.py b/src/Mod/Path/PathScripts/PathWaterline.py index 2f2ec32da7..071773ad61 100644 --- a/src/Mod/Path/PathScripts/PathWaterline.py +++ b/src/Mod/Path/PathScripts/PathWaterline.py @@ -22,7 +22,6 @@ # *************************************************************************** from __future__ import print_function -from PySide import QtCore import FreeCAD __title__ = "Path Waterline Operation" @@ -31,11 +30,13 @@ __url__ = "http://www.freecadweb.org" __doc__ = "Class and implementation of Waterline operation." __contributors__ = "" +translate = FreeCAD.Qt.translate + # OCL must be installed try: import ocl except ImportError: - msg = QtCore.QCoreApplication.translate( + msg = translate( "path_waterline", "This operation requires OpenCamLib to be installed." ) FreeCAD.Console.PrintError(msg + "\n") @@ -64,7 +65,6 @@ if False: else: PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) -translate = FreeCAD.Qt.translate class ObjectWaterline(PathOp.ObjectOp):