From a6301d0ec16640a266cb12c65cd6c17d8af6da04 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Wed, 22 Dec 2021 11:46:00 -0600 Subject: [PATCH] Translation cleanup --- src/Mod/Path/PathScripts/PathPlane.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathPlane.py b/src/Mod/Path/PathScripts/PathPlane.py index 365554c9a3..d25fa76e2f 100644 --- a/src/Mod/Path/PathScripts/PathPlane.py +++ b/src/Mod/Path/PathScripts/PathPlane.py @@ -26,10 +26,7 @@ import FreeCAD import FreeCADGui import Path from PySide import QtCore - -# Qt translation handling -def translate(context, text, disambig=None): - return QtCore.QCoreApplication.translate(context, text, disambig) +from PySide.QtCore import QT_TRANSLATE_NOOP class Plane: @@ -38,14 +35,14 @@ class Plane: "App::PropertyEnumeration", "SelectionPlane", "Path", - QtCore.QT_TRANSLATE_NOOP("App::Property", "Orientation plane of CNC path"), + QT_TRANSLATE_NOOP("App::Property", "Orientation plane of CNC path"), ) obj.SelectionPlane = ["XY", "XZ", "YZ"] obj.addProperty( "App::PropertyBool", "Active", "Path", - QtCore.QT_TRANSLATE_NOOP( + QT_TRANSLATE_NOOP( "App::Property", "Make False, to prevent operation from generating code" ), ) @@ -117,10 +114,10 @@ class _ViewProviderPlane: class CommandPathPlane: def GetResources(self): return { - "Pixmap": "Path_Plane", - "MenuText": QtCore.QT_TRANSLATE_NOOP("Path_Plane", "Selection Plane"), - "ToolTip": QtCore.QT_TRANSLATE_NOOP( - "Path_Plane", "Create a Selection Plane object" + "Pixmap": "PathPlane", + "MenuText": QT_TRANSLATE_NOOP("PathPlane", "Selection Plane"), + "ToolTip": QT_TRANSLATE_NOOP( + "PathPlane", "Create a Selection Plane object" ), } @@ -132,9 +129,7 @@ class CommandPathPlane: return False def Activated(self): - FreeCAD.ActiveDocument.openTransaction( - translate("Path_Plane", "Create a Selection Plane object") - ) + FreeCAD.ActiveDocument.openTransaction("Create a Selection Plane object") FreeCADGui.addModule("PathScripts.PathPlane") snippet = """ import Path