From f3d6bd21e37338aaa037093f5bd54aba9b02143b Mon Sep 17 00:00:00 2001 From: sliptonic Date: Sat, 18 Dec 2021 10:20:36 -0600 Subject: [PATCH] translation cleanup PathCustom/gui --- src/Mod/Path/PathScripts/PathCustom.py | 15 ++++++++------- src/Mod/Path/PathScripts/PathCustomGui.py | 19 ++++--------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathCustom.py b/src/Mod/Path/PathScripts/PathCustom.py index c8e517b4b3..17b03f830d 100644 --- a/src/Mod/Path/PathScripts/PathCustom.py +++ b/src/Mod/Path/PathScripts/PathCustom.py @@ -26,7 +26,7 @@ import Path import PathScripts.PathOp as PathOp import PathScripts.PathLog as PathLog -from PySide import QtCore +from PySide.QtCore import QT_TRANSLATE_NOOP __title__ = "Path Custom Operation" __author__ = "sliptonic (Brad Collette)" @@ -34,13 +34,14 @@ __url__ = "http://www.freecadweb.org" __doc__ = "Path Custom object and FreeCAD command" -PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) -# PathLog.trackModule(PathLog.thisModule()) +if False: + PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) + PathLog.trackModule(PathLog.thisModule()) +else: + PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) -# Qt translation handling -def translate(context, text, disambig=None): - return QtCore.QCoreApplication.translate(context, text, disambig) +translate = FreeCAD.Qt.translate class ObjectCustom(PathOp.ObjectOp): @@ -52,7 +53,7 @@ class ObjectCustom(PathOp.ObjectOp): "App::PropertyStringList", "Gcode", "Path", - QtCore.QT_TRANSLATE_NOOP("PathCustom", "The gcode to be inserted"), + QT_TRANSLATE_NOOP("App::Property", "The gcode to be inserted"), ) obj.Proxy = self diff --git a/src/Mod/Path/PathScripts/PathCustomGui.py b/src/Mod/Path/PathScripts/PathCustomGui.py index 39c237cdcd..184229247d 100644 --- a/src/Mod/Path/PathScripts/PathCustomGui.py +++ b/src/Mod/Path/PathScripts/PathCustomGui.py @@ -25,7 +25,8 @@ import FreeCADGui import PathScripts.PathCustom as PathCustom import PathScripts.PathOpGui as PathOpGui -from PySide import QtCore +from PySide.QtCore import QT_TRANSLATE_NOOP + __title__ = "Path Custom Operation UI" __author__ = "sliptonic (Brad Collette)" @@ -33,18 +34,6 @@ __url__ = "http://www.freecadweb.org" __doc__ = "Custom operation page controller and command implementation." -# Qt translation handling -def translate(context, text, disambig=None): - return QtCore.QCoreApplication.translate(context, text, disambig) - - -# class TaskPanelBaseGeometryPage(PathOpGui.TaskPanelBaseGeometryPage): -# '''Page controller for the base geometry.''' - -# def getForm(self): -# return None - - class TaskPanelOpPage(PathOpGui.TaskPanelPage): """Page controller class for the Custom operation.""" @@ -80,8 +69,8 @@ Command = PathOpGui.SetupOperation( PathCustom.Create, TaskPanelOpPage, "Path_Custom", - QtCore.QT_TRANSLATE_NOOP("Path_Custom", "Custom"), - QtCore.QT_TRANSLATE_NOOP("Path_Custom", "Create custom gcode snippet"), + QT_TRANSLATE_NOOP("Path_Custom", "Custom"), + QT_TRANSLATE_NOOP("Path_Custom", "Create custom gcode snippet"), PathCustom.SetupProperties, )