From d0d15f956f6c46a655e15b7447d6fd40ba8ac33b Mon Sep 17 00:00:00 2001 From: sliptonic Date: Sat, 18 Dec 2021 10:30:58 -0600 Subject: [PATCH] Translation cleanup PathUtils/PathUtil --- src/Mod/Path/PathScripts/PathUtil.py | 12 +++++++----- src/Mod/Path/PathScripts/PathUtils.py | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathUtil.py b/src/Mod/Path/PathScripts/PathUtil.py index 02776b3ab1..5f2c8b9bdc 100644 --- a/src/Mod/Path/PathScripts/PathUtil.py +++ b/src/Mod/Path/PathScripts/PathUtil.py @@ -30,15 +30,17 @@ So if you add to this file and think about importing anything from PathScripts other than PathLog, then it probably doesn't belong here. """ +import FreeCAD import six import PathScripts.PathLog as PathLog -import PySide -PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) +translate = FreeCAD.Qt.translate - -def translate(context, text, disambig=None): - return PySide.QtCore.QCoreApplication.translate(context, text, disambig) +if False: + PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) + PathLog.trackModule(PathLog.thisModule()) +else: + PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) def _getProperty(obj, prop): diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index a97679bae7..4d4f2426fb 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -41,12 +41,14 @@ DraftGeomUtils = LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils") Part = LazyLoader("Part", globals(), "Part") TechDraw = LazyLoader("TechDraw", globals(), "TechDraw") -PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) -# PathLog.trackModule(PathLog.thisModule()) +translate = FreeCAD.Qt.translate -def translate(context, text, disambig=None): - return QtCore.QCoreApplication.translate(context, text, disambig) +if False: + PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) + PathLog.trackModule(PathLog.thisModule()) +else: + PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) UserInput = None @@ -179,7 +181,7 @@ def isDrillable(obj, candidate, tooldiameter=None, includePartials=False): PathLog.debug("candidate is drillable: {}".format(drillable)) except Exception as ex: # pylint: disable=broad-except PathLog.warning( - translate("PathUtils", "Issue determine drillability: {}").format(ex) + translate("Path", "Issue determine drillability: {}").format(ex) ) return drillable