From 90c3d5d5d3412b062d0bc2f561a6ce663fdfaa0e Mon Sep 17 00:00:00 2001 From: hasecilu Date: Tue, 15 Oct 2024 12:45:36 -0600 Subject: [PATCH 1/7] Rename commands This change is to make when using "What's this?" feature on the Curves commands the correct Wiki documentation page is opened. --- freecad/Curves/Discretize.py | 2 +- freecad/Curves/DraftAnalysisFP.py | 2 +- freecad/Curves/ExtractShapes.py | 2 +- freecad/Curves/GeomInfo.py | 2 +- freecad/Curves/HQRuledSurfaceFP.py | 2 +- freecad/Curves/IsoCurve.py | 2 +- freecad/Curves/JoinCurves.py | 2 +- freecad/Curves/ParametricBlendCurve.py | 2 +- freecad/Curves/ParametricComb.py | 5 +-- freecad/Curves/ProfileSketch.py | 2 +- freecad/Curves/ReflectLinesFP.py | 2 +- freecad/Curves/RotationSweepFP.py | 2 +- freecad/Curves/Sketch_On_Surface.py | 2 +- freecad/Curves/Sweep2Rails.py | 2 +- freecad/Curves/TrimFace.py | 3 +- freecad/Curves/Truncate_Extend_FP.py | 2 +- freecad/Curves/ZebraTool.py | 2 +- freecad/Curves/adjacent_faces.py | 2 +- freecad/Curves/approximate.py | 5 +-- freecad/Curves/blendSolidFP.py | 2 +- freecad/Curves/blendSurfaceFP_new.py | 2 +- freecad/Curves/comp_spring.py | 2 +- freecad/Curves/curveOnSurfaceFP.py | 2 +- freecad/Curves/curve_to_script.py | 2 +- freecad/Curves/gordonFP.py | 2 +- freecad/Curves/gordon_profile_FP.py | 2 +- freecad/Curves/init_gui.py | 62 +++++++++++++++++++++----- freecad/Curves/interpolate.py | 2 +- freecad/Curves/lineFP.py | 2 +- freecad/Curves/mixed_curve.py | 2 +- freecad/Curves/multiLoftFP.py | 2 +- freecad/Curves/parametricSolid.py | 2 +- freecad/Curves/pasteSVG.py | 2 +- freecad/Curves/pipeshellFP.py | 2 +- freecad/Curves/pipeshellProfileFP.py | 2 +- freecad/Curves/segmentSurfaceFP.py | 2 +- freecad/Curves/splitCurves_2.py | 2 +- freecad/Curves/toConsole.py | 2 +- 38 files changed, 87 insertions(+), 56 deletions(-) diff --git a/freecad/Curves/Discretize.py b/freecad/Curves/Discretize.py index 81ce8c5..117f177 100644 --- a/freecad/Curves/Discretize.py +++ b/freecad/Curves/Discretize.py @@ -301,4 +301,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('Discretize', discretize()) +FreeCADGui.addCommand("Curves_Discretize", discretize()) diff --git a/freecad/Curves/DraftAnalysisFP.py b/freecad/Curves/DraftAnalysisFP.py index 6bc0a47..4cc6975 100644 --- a/freecad/Curves/DraftAnalysisFP.py +++ b/freecad/Curves/DraftAnalysisFP.py @@ -198,4 +198,4 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('Curves_DraftAnalysis', DraftAnalysisCommand()) +FreeCADGui.addCommand("Curves_DraftAnalysis", DraftAnalysisCommand()) diff --git a/freecad/Curves/ExtractShapes.py b/freecad/Curves/ExtractShapes.py index 06a4ac6..02aa418 100644 --- a/freecad/Curves/ExtractShapes.py +++ b/freecad/Curves/ExtractShapes.py @@ -36,4 +36,4 @@ def GetResources(self): 'ToolTip': "{}\n\n{}".format(__title__, __doc__)} -FreeCADGui.addCommand('extract', extract()) +FreeCADGui.addCommand("Curves_ExtractSubshape", extract()) diff --git a/freecad/Curves/GeomInfo.py b/freecad/Curves/GeomInfo.py index 1563be9..45df632 100644 --- a/freecad/Curves/GeomInfo.py +++ b/freecad/Curves/GeomInfo.py @@ -641,4 +641,4 @@ def GetResources(self): 'Checkable': False} -FreeCADGui.addCommand('GeomInfo', GeomInfo()) +FreeCADGui.addCommand("Curves_GeometryInfo", GeomInfo()) diff --git a/freecad/Curves/HQRuledSurfaceFP.py b/freecad/Curves/HQRuledSurfaceFP.py index 9937a5d..a47a8f2 100644 --- a/freecad/Curves/HQRuledSurfaceFP.py +++ b/freecad/Curves/HQRuledSurfaceFP.py @@ -189,4 +189,4 @@ def GetResources(self): 'MenuText': __title__, 'ToolTip': __doc__} -FreeCADGui.addCommand('hq_ruled_surface', HQ_Ruled_Surface_Command()) +FreeCADGui.addCommand("hq_ruled_surface", HQ_Ruled_Surface_Command()) diff --git a/freecad/Curves/IsoCurve.py b/freecad/Curves/IsoCurve.py index f03b512..cc3893c 100644 --- a/freecad/Curves/IsoCurve.py +++ b/freecad/Curves/IsoCurve.py @@ -222,7 +222,7 @@ def IsActive(self): if App.GuiUp: - Gui.addCommand("IsoCurve", CommandMacroIsoCurve()) + Gui.addCommand("Curves_IsoCurve", CommandMacroIsoCurve()) def run(): diff --git a/freecad/Curves/JoinCurves.py b/freecad/Curves/JoinCurves.py index ab51549..015df04 100644 --- a/freecad/Curves/JoinCurves.py +++ b/freecad/Curves/JoinCurves.py @@ -258,4 +258,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('join', joinCommand()) +FreeCADGui.addCommand("Curves_JoinCurve", joinCommand()) diff --git a/freecad/Curves/ParametricBlendCurve.py b/freecad/Curves/ParametricBlendCurve.py index 7262f98..27902e9 100644 --- a/freecad/Curves/ParametricBlendCurve.py +++ b/freecad/Curves/ParametricBlendCurve.py @@ -745,4 +745,4 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('ParametricBlendCurve', ParametricBlendCurve()) +FreeCADGui.addCommand("Curves_ParametricBlendCurve", ParametricBlendCurve()) diff --git a/freecad/Curves/ParametricComb.py b/freecad/Curves/ParametricComb.py index 4779318..75c8d08 100644 --- a/freecad/Curves/ParametricComb.py +++ b/freecad/Curves/ParametricComb.py @@ -602,7 +602,4 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('ParametricComb', ParametricComb()) - - - +FreeCADGui.addCommand("Curves_ParametricComb", ParametricComb()) diff --git a/freecad/Curves/ProfileSketch.py b/freecad/Curves/ProfileSketch.py index eec2f99..9f9656d 100644 --- a/freecad/Curves/ProfileSketch.py +++ b/freecad/Curves/ProfileSketch.py @@ -160,4 +160,4 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('profileSupportCmd', profSupCommand()) +FreeCADGui.addCommand("Curves_ProfileSupportPlane", profSupCommand()) diff --git a/freecad/Curves/ReflectLinesFP.py b/freecad/Curves/ReflectLinesFP.py index 60f75f8..746a60f 100644 --- a/freecad/Curves/ReflectLinesFP.py +++ b/freecad/Curves/ReflectLinesFP.py @@ -211,4 +211,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('ReflectLines', ReflectLinesCommand()) +FreeCADGui.addCommand("Curves_ReflectLines", ReflectLinesCommand()) diff --git a/freecad/Curves/RotationSweepFP.py b/freecad/Curves/RotationSweepFP.py index 1e36e0d..710ca47 100644 --- a/freecad/Curves/RotationSweepFP.py +++ b/freecad/Curves/RotationSweepFP.py @@ -215,4 +215,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('Curves_RotationSweep', RotsweepFPCommand()) +FreeCADGui.addCommand("Curves_RotationSweep", RotsweepFPCommand()) diff --git a/freecad/Curves/Sketch_On_Surface.py b/freecad/Curves/Sketch_On_Surface.py index de650a1..4c5bc62 100644 --- a/freecad/Curves/Sketch_On_Surface.py +++ b/freecad/Curves/Sketch_On_Surface.py @@ -539,4 +539,4 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('SoS', SoS()) +FreeCADGui.addCommand("Curves_SketchOnSurface", SoS()) diff --git a/freecad/Curves/Sweep2Rails.py b/freecad/Curves/Sweep2Rails.py index 7598a6c..df469d5 100644 --- a/freecad/Curves/Sweep2Rails.py +++ b/freecad/Curves/Sweep2Rails.py @@ -225,4 +225,4 @@ def GetResources(self): 'ToolTip': 'Sweep profiles on 2 rails'} -FreeCADGui.addCommand('sw2r', s2rCommand()) +FreeCADGui.addCommand("Curves_SweepToRails", s2rCommand()) diff --git a/freecad/Curves/TrimFace.py b/freecad/Curves/TrimFace.py index df98ea8..bd0be06 100644 --- a/freecad/Curves/TrimFace.py +++ b/freecad/Curves/TrimFace.py @@ -235,7 +235,6 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('Trim', trim()) - +FreeCADGui.addCommand("Curves_Trim", trim()) diff --git a/freecad/Curves/Truncate_Extend_FP.py b/freecad/Curves/Truncate_Extend_FP.py index 25b8b4c..27e40d8 100644 --- a/freecad/Curves/Truncate_Extend_FP.py +++ b/freecad/Curves/Truncate_Extend_FP.py @@ -142,4 +142,4 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('Curve_TruncateExtendCmd', TruncateExtendCommand()) +FreeCADGui.addCommand("Curves_TruncateExtendCmd", TruncateExtendCommand()) diff --git a/freecad/Curves/ZebraTool.py b/freecad/Curves/ZebraTool.py index d777b36..0b46de1 100644 --- a/freecad/Curves/ZebraTool.py +++ b/freecad/Curves/ZebraTool.py @@ -148,4 +148,4 @@ def GetResources(self): 'ToolTip': 'Zebra texture for surface inspection'} -FreeCADGui.addCommand('ZebraTool', ZebraTool()) +FreeCADGui.addCommand("Curves_ZebraTool", ZebraTool()) diff --git a/freecad/Curves/adjacent_faces.py b/freecad/Curves/adjacent_faces.py index af4cf73..58af292 100644 --- a/freecad/Curves/adjacent_faces.py +++ b/freecad/Curves/adjacent_faces.py @@ -78,4 +78,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}
".format(__doc__, __usage__)} -addCommand('Curves_adjacent_faces', adjacentfacesCommand()) +addCommand("Curves_AdjacentFaces", adjacentfacesCommand()) diff --git a/freecad/Curves/approximate.py b/freecad/Curves/approximate.py index 7911b2b..870d999 100644 --- a/freecad/Curves/approximate.py +++ b/freecad/Curves/approximate.py @@ -416,7 +416,4 @@ def GetResources(self): 'ToolTip': 'Approximate points to NURBS curve or surface'} -FreeCADGui.addCommand('Approximate', approx()) - - - +FreeCADGui.addCommand("Curves_Approximate", approx()) diff --git a/freecad/Curves/blendSolidFP.py b/freecad/Curves/blendSolidFP.py index 5196b0c..55290d5 100644 --- a/freecad/Curves/blendSolidFP.py +++ b/freecad/Curves/blendSolidFP.py @@ -248,4 +248,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('Curves_BlendSolid', BlendSolidCommand()) +FreeCADGui.addCommand("Curves_BlendSolid", BlendSolidCommand()) diff --git a/freecad/Curves/blendSurfaceFP_new.py b/freecad/Curves/blendSurfaceFP_new.py index e430c99..208a570 100644 --- a/freecad/Curves/blendSurfaceFP_new.py +++ b/freecad/Curves/blendSurfaceFP_new.py @@ -159,4 +159,4 @@ def GetResources(self): if FreeCAD.GuiUp: - FreeCADGui.addCommand('Curves_BlendSurf2', BlendSurf2Command()) + FreeCADGui.addCommand("Curves_BlendSurf2", BlendSurf2Command()) diff --git a/freecad/Curves/comp_spring.py b/freecad/Curves/comp_spring.py index f5bbbcc..7cb666a 100644 --- a/freecad/Curves/comp_spring.py +++ b/freecad/Curves/comp_spring.py @@ -185,4 +185,4 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('comp_spring', CompSpringCommand()) +FreeCADGui.addCommand("Curves_CompressionSpring", CompSpringCommand()) diff --git a/freecad/Curves/curveOnSurfaceFP.py b/freecad/Curves/curveOnSurfaceFP.py index 5ebddd1..e182d82 100644 --- a/freecad/Curves/curveOnSurfaceFP.py +++ b/freecad/Curves/curveOnSurfaceFP.py @@ -148,4 +148,4 @@ def GetResources(self): 'MenuText': 'CurveOnSurface', 'ToolTip': 'Create a curve on surface object'} -FreeCADGui.addCommand('cos', cosCommand()) +FreeCADGui.addCommand("Curves_CurveOnSurface", cosCommand()) diff --git a/freecad/Curves/curve_to_script.py b/freecad/Curves/curve_to_script.py index 7cd1286..a372de0 100644 --- a/freecad/Curves/curve_to_script.py +++ b/freecad/Curves/curve_to_script.py @@ -112,4 +112,4 @@ def IsActive(self): return False -FreeCADGui.addCommand('Curves_bspline_to_console', NurbsToConsole()) +FreeCADGui.addCommand("Curves_BsplineToConsole", NurbsToConsole()) diff --git a/freecad/Curves/gordonFP.py b/freecad/Curves/gordonFP.py index 6f18f0a..7cee9bc 100644 --- a/freecad/Curves/gordonFP.py +++ b/freecad/Curves/gordonFP.py @@ -223,4 +223,4 @@ def GetResources(self): 'ToolTip': 'Creates a surface that skins a network of curves'} -FreeCADGui.addCommand('gordon', gordonCommand()) +FreeCADGui.addCommand("Curves_GordonSurface", gordonCommand()) diff --git a/freecad/Curves/gordon_profile_FP.py b/freecad/Curves/gordon_profile_FP.py index b7f0699..3659f47 100644 --- a/freecad/Curves/gordon_profile_FP.py +++ b/freecad/Curves/gordon_profile_FP.py @@ -357,4 +357,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('gordon_profile', GordonProfileCommand()) +FreeCADGui.addCommand("Curves_EditableSpline", GordonProfileCommand()) diff --git a/freecad/Curves/init_gui.py b/freecad/Curves/init_gui.py index 8d2686f..c0547fe 100644 --- a/freecad/Curves/init_gui.py +++ b/freecad/Curves/init_gui.py @@ -69,18 +69,53 @@ def Initialize(self): # from . import HelicalSweepFP # import sectionSketch - curvelist = ["Curves_line", "gordon_profile", "mixed_curve", "extend", "join", "split", - "Discretize", "Approximate", "Interpolate", "ParametricBlendCurve", - "ParametricComb", "cos"] - - surflist = ["ZebraTool", "Trim", "IsoCurve", "SoS", "sw2r", "profileSupportCmd", - "profile", "pipeshell", "gordon", "segment_surface", "comp_spring", - "ReflectLines", "MultiLoft", "Curves_BlendSurf2", "Curves_BlendSolid", - "Curves_FlattenFace", "Curves_RotationSweep", 'Curves_SurfaceAnalysis', - 'Curves_DraftAnalysis', "Curve_TruncateExtendCmd"] + curvelist = [ + "Curves_Line", + "Curves_EditableSpline", + "Curves_MixedCurve", + "Curves_ExtendCurve", + "Curves_JoinCurve", + "Curves_SplitCurve", + "Curves_Discretize", + "Curves_Approximate", + "Curves_Interpolate", + "Curves_ParametricBlendCurve", + "Curves_ParametricComb", + "Curves_CurveOnSurface", + ] + + surflist = [ + "Curves_ZebraTool", + "Curves_Trim", + "Curves_IsoCurve", + "Curves_SketchOnSurface", + "Curves_SweepToRails", + "Curves_ProfileSupportPlane", + "Curves_PipeshellProfile", + "Curves_Pipeshell", + "Curves_GordonSurface", + "Curves_SegmentSurface", + "Curves_CompressionSpring", + "Curves_ReflectLines", + "Curves_MultiLoft", + "Curves_BlendSurf2", + "Curves_BlendSolid", + "Curves_FlattenFace", + "Curves_RotationSweep", + "Curves_SurfaceAnalysis", + "Curves_DraftAnalysis", + "Curves_TruncateExtendCmd", + ] # , "Curves_ProfileSupport", "Curves_Sweep2Rails"] - misclist = ["GeomInfo", "extract", "solid", "pasteSVG", "to_console", "Curves_adjacent_faces", - "Curves_bspline_to_console"] + misclist = [ + "Curves_GeometryInfo", + "Curves_ExtractSubshape", + "Curves_ParametricSolid", + "Curves_PasteSVG", + "Curves_ObjectsToConsole", + "Curves_AdjacentFaces", + "Curves_BsplineToConsole", + ] self.appendToolbar("Curves", curvelist) self.appendToolbar("Surfaces", surflist) @@ -136,8 +171,11 @@ def ContextMenu(self, recipient): """This is executed whenever the user right-clicks on screen. recipient" will be either 'view' or 'tree'""" if recipient == "View": - contextlist = ["Curves_adjacent_faces", "Curves_bspline_to_console"] # list of commands self.appendContextMenu("Curves", contextlist) + contextlist = [ + "Curves_AdjacentFaces", + "Curves_BsplineToConsole", + ] # list of commands elif recipient == "Tree": contextlist = [] # list of commands self.appendContextMenu("Curves", contextlist) diff --git a/freecad/Curves/interpolate.py b/freecad/Curves/interpolate.py index a89caa9..0cbde8f 100644 --- a/freecad/Curves/interpolate.py +++ b/freecad/Curves/interpolate.py @@ -379,4 +379,4 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('Interpolate', interpolate()) +FreeCADGui.addCommand("Curves_Interpolate", interpolate()) diff --git a/freecad/Curves/lineFP.py b/freecad/Curves/lineFP.py index c2f972f..eb680eb 100644 --- a/freecad/Curves/lineFP.py +++ b/freecad/Curves/lineFP.py @@ -96,4 +96,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('Curves_line', lineCommand()) +FreeCADGui.addCommand("Curves_Line", lineCommand()) diff --git a/freecad/Curves/mixed_curve.py b/freecad/Curves/mixed_curve.py index 912ef9a..cb90699 100644 --- a/freecad/Curves/mixed_curve.py +++ b/freecad/Curves/mixed_curve.py @@ -194,4 +194,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('mixed_curve', MixedCurveCmd()) +FreeCADGui.addCommand("Curves_MixedCurve", MixedCurveCmd()) diff --git a/freecad/Curves/multiLoftFP.py b/freecad/Curves/multiLoftFP.py index 6e4f933..53b2826 100644 --- a/freecad/Curves/multiLoftFP.py +++ b/freecad/Curves/multiLoftFP.py @@ -129,4 +129,4 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('MultiLoft', MultiLoftCommand()) +FreeCADGui.addCommand("Curves_MultiLoft", MultiLoftCommand()) diff --git a/freecad/Curves/parametricSolid.py b/freecad/Curves/parametricSolid.py index ba7014f..eb069fa 100644 --- a/freecad/Curves/parametricSolid.py +++ b/freecad/Curves/parametricSolid.py @@ -191,4 +191,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('solid', solidCommand()) +FreeCADGui.addCommand("Curves_ParametricSolid", solidCommand()) diff --git a/freecad/Curves/pasteSVG.py b/freecad/Curves/pasteSVG.py index f47d254..26228e0 100644 --- a/freecad/Curves/pasteSVG.py +++ b/freecad/Curves/pasteSVG.py @@ -48,4 +48,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('pasteSVG', pasteSVG()) +FreeCADGui.addCommand("Curves_PasteSVG", pasteSVG()) diff --git a/freecad/Curves/pipeshellFP.py b/freecad/Curves/pipeshellFP.py index cd6fb35..ac24417 100644 --- a/freecad/Curves/pipeshellFP.py +++ b/freecad/Curves/pipeshellFP.py @@ -387,4 +387,4 @@ def GetResources(self): 'ToolTip': __doc__} -FreeCADGui.addCommand('pipeshell', pipeShellCommand()) +FreeCADGui.addCommand("Curves_Pipeshell", pipeShellCommand()) diff --git a/freecad/Curves/pipeshellProfileFP.py b/freecad/Curves/pipeshellProfileFP.py index 6d24171..73292b9 100644 --- a/freecad/Curves/pipeshellProfileFP.py +++ b/freecad/Curves/pipeshellProfileFP.py @@ -174,4 +174,4 @@ def GetResources(self): 'MenuText': __title__, 'ToolTip': __doc__} -FreeCADGui.addCommand('profile', profileCommand()) +FreeCADGui.addCommand("Curves_PipeshellProfile", profileCommand()) diff --git a/freecad/Curves/segmentSurfaceFP.py b/freecad/Curves/segmentSurfaceFP.py index 99df389..91747bb 100644 --- a/freecad/Curves/segmentSurfaceFP.py +++ b/freecad/Curves/segmentSurfaceFP.py @@ -219,4 +219,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('segment_surface', SegSurfCommand()) +FreeCADGui.addCommand("Curves_SegmentSurface", SegSurfCommand()) diff --git a/freecad/Curves/splitCurves_2.py b/freecad/Curves/splitCurves_2.py index 2121e1f..2cc29d7 100644 --- a/freecad/Curves/splitCurves_2.py +++ b/freecad/Curves/splitCurves_2.py @@ -689,4 +689,4 @@ def GetResources(self): 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} -FreeCADGui.addCommand('split', splitCommand()) +FreeCADGui.addCommand("Curves_SplitCurve", splitCommand()) diff --git a/freecad/Curves/toConsole.py b/freecad/Curves/toConsole.py index e81d171..41c873d 100644 --- a/freecad/Curves/toConsole.py +++ b/freecad/Curves/toConsole.py @@ -93,4 +93,4 @@ def IsActive(self): return False -FreeCADGui.addCommand('to_console', ToConsole()) +FreeCADGui.addCommand("Curves_ObjectsToConsole", ToConsole()) From 63d0caff53eb5d1f80350a17e464ba6e37d28624 Mon Sep 17 00:00:00 2001 From: hasecilu Date: Tue, 15 Oct 2024 13:07:23 -0600 Subject: [PATCH 2/7] Mark strings for translation support - Properties' tooltips - Log messages --- freecad/Curves/BSplineAlgorithms.py | 25 ++-- freecad/Curves/BSplineApproxInterp.py | 25 ++-- freecad/Curves/Blending/smooth_objects.py | 4 +- freecad/Curves/Discretize.py | 105 ++++++++++--- freecad/Curves/DraftAnalysisFP.py | 104 +++++++++---- freecad/Curves/FC_interaction_example.py | 7 +- freecad/Curves/FaceMapFP.py | 38 +++-- freecad/Curves/FlattenFP.py | 30 +++- freecad/Curves/GeomInfo.py | 4 +- freecad/Curves/HQRuledSurfaceFP.py | 66 +++++++-- freecad/Curves/HelicalSweepFP.py | 35 ++++- freecad/Curves/IsoCurve.py | 45 +++++- freecad/Curves/JoinCurves.py | 60 ++++++-- freecad/Curves/Outline_FP.py | 16 +- freecad/Curves/ParametricBlendCurve.py | 101 ++++++++++--- freecad/Curves/ParametricComb.py | 32 ++-- freecad/Curves/PlateSurface.py | 32 ++-- freecad/Curves/PointInterpolation.py | 10 +- freecad/Curves/ProfileSketch.py | 48 ++++-- freecad/Curves/ProfileSupportFP.py | 76 +++++++--- freecad/Curves/ReflectLinesFP.py | 34 ++--- freecad/Curves/RotationSweepFP.py | 14 +- freecad/Curves/Sketch_On_Surface.py | 87 ++++++++--- freecad/Curves/SurfaceAnalysisFP.py | 108 ++++++++++---- freecad/Curves/Sweep2Rails.py | 72 +++++++-- freecad/Curves/Sweep2RailsFP.py | 6 +- freecad/Curves/TemplateFP.py | 6 +- freecad/Curves/TrimFace.py | 48 ++++-- freecad/Curves/Truncate_Extend_FP.py | 44 ++++-- freecad/Curves/ZebraTool.py | 2 +- freecad/Curves/__init__.py | 1 + freecad/Curves/_utils.py | 2 +- freecad/Curves/adjacent_faces.py | 2 +- freecad/Curves/approximate.py | 139 ++++++++++++----- freecad/Curves/approximate_extension.py | 16 +- freecad/Curves/blendSolidFP.py | 30 ++-- freecad/Curves/blendSurface.py | 2 +- freecad/Curves/blendSurfaceFP.py | 38 ++--- freecad/Curves/blendSurfaceFP_new.py | 18 +-- freecad/Curves/blend_curve.py | 2 +- freecad/Curves/comp_spring.py | 54 ++++++- freecad/Curves/continuity_check.py | 10 +- freecad/Curves/curveExtend.py | 2 +- freecad/Curves/curveExtendFP.py | 52 +++++-- freecad/Curves/curveOnSurface.py | 8 +- freecad/Curves/curveOnSurfaceFP.py | 97 +++++++++--- freecad/Curves/curve_to_script.py | 2 +- freecad/Curves/curves_to_surface.py | 16 +- freecad/Curves/gordon.py | 6 +- freecad/Curves/gordonFP.py | 73 +++++++-- freecad/Curves/gordon_profile_FP.py | 24 +-- freecad/Curves/graphics.py | 2 +- freecad/Curves/grid.py | 20 +-- freecad/Curves/init_gui.py | 30 ++-- freecad/Curves/interpolate.py | 122 ++++++++++++--- freecad/Curves/isocurves.py | 14 +- freecad/Curves/lineFP.py | 8 +- freecad/Curves/map_on_face.py | 4 +- freecad/Curves/mixed_curve.py | 58 ++++++-- freecad/Curves/multiLoftFP.py | 36 ++++- freecad/Curves/nurbs_surface_match.py | 26 ++-- freecad/Curves/nurbs_tools.py | 6 +- freecad/Curves/parametricSolid.py | 35 +++-- freecad/Curves/pasteSVG.py | 2 +- freecad/Curves/pipeshellFP.py | 173 ++++++++++++++++++---- freecad/Curves/pipeshellProfileFP.py | 50 +++++-- freecad/Curves/profile_editor.py | 18 +-- freecad/Curves/property_editor.py | 6 +- freecad/Curves/segmentSurfaceFP.py | 73 +++++++-- freecad/Curves/splitCurves_2.py | 98 +++++++----- freecad/Curves/sublink_edit.py | 14 +- 71 files changed, 1949 insertions(+), 724 deletions(-) diff --git a/freecad/Curves/BSplineAlgorithms.py b/freecad/Curves/BSplineAlgorithms.py index 6e5d69c..64fb8dc 100644 --- a/freecad/Curves/BSplineAlgorithms.py +++ b/freecad/Curves/BSplineAlgorithms.py @@ -10,6 +10,7 @@ from math import pi from freecad.Curves.BSplineApproxInterp import BSplineApproxInterp +translate = FreeCAD.Qt.translate vec2d = Base.Vector2d DEBUG = False @@ -18,27 +19,29 @@ def debug(o): if not DEBUG: return if isinstance(o, Part.BSplineCurve): - FreeCAD.Console.PrintWarning("\nBSplineCurve\n") - FreeCAD.Console.PrintWarning("Degree: {}\n".format(o.Degree)) - FreeCAD.Console.PrintWarning("NbPoles: {}\n".format(o.NbPoles)) - FreeCAD.Console.PrintWarning("Knots: {} ({:0.2f} - {:0.2f})\n".format(o.NbKnots, o.FirstParameter, o.LastParameter)) - FreeCAD.Console.PrintWarning("Mults: {}\n".format(o.getMultiplicities())) - FreeCAD.Console.PrintWarning("Periodic: {}\n".format(o.isPeriodic())) + FreeCAD.Console.PrintWarning(translate("Log", "\nBSplineCurve\n")) + FreeCAD.Console.PrintWarning(translate("Log", "Degree: {}\n")).format(o.Degree) + FreeCAD.Console.PrintWarning(translate("Log", "NbPoles: {}\n")).format(o.NbPoles) + FreeCAD.Console.PrintWarning(translate("Log", "Knots: {} ({:0.2f} - {:0.2f})\n")).format( + o.NbKnots, o.FirstParameter, o.LastParameter + ) + FreeCAD.Console.PrintWarning(translate("Log", "Mults: {}\n")).format(o.getMultiplicities()) + FreeCAD.Console.PrintWarning(translate("Log", "Periodic: {}\n")).format(o.isPeriodic()) elif isinstance(o, Part.BSplineSurface): - FreeCAD.Console.PrintWarning("\nBSplineSurface\n************\n") + FreeCAD.Console.PrintWarning(translate("Log", "\nBSplineSurface\n************\n")) try: u = o.uIso(o.getUKnot(1)) debug(u) except Part.OCCError: - FreeCAD.Console.PrintError("Failed to compute uIso curve\n") + FreeCAD.Console.PrintError(translate("Log", "Failed to compute uIso curve\n")) try: v = o.vIso(o.getVKnot(1)) debug(v) except Part.OCCError: - FreeCAD.Console.PrintError("Failed to compute vIso curve\n") - FreeCAD.Console.PrintWarning("************\n") + FreeCAD.Console.PrintError(translate("Log", "Failed to compute vIso curve\n")) + FreeCAD.Console.PrintWarning(translate("Log", "************\n")) else: - FreeCAD.Console.PrintMessage("{}\n".format(str(o))) + FreeCAD.Console.PrintMessage(translate("Log", "{}\n")).format(str(o)) def IsInsideTolerance(array, value, tolerance=1e-15): diff --git a/freecad/Curves/BSplineApproxInterp.py b/freecad/Curves/BSplineApproxInterp.py index 57cc418..3caba4f 100644 --- a/freecad/Curves/BSplineApproxInterp.py +++ b/freecad/Curves/BSplineApproxInterp.py @@ -10,6 +10,7 @@ from freecad.Curves import nurbs_tools # from math import pi +translate = FreeCAD.Qt.translate DEBUG = False @@ -17,27 +18,29 @@ def debug(o): if not DEBUG: return if isinstance(o, Part.BSplineCurve): - FreeCAD.Console.PrintWarning("\nBSplineCurve\n") - FreeCAD.Console.PrintWarning("Degree: {}\n".format(o.Degree)) - FreeCAD.Console.PrintWarning("NbPoles: {}\n".format(o.NbPoles)) - FreeCAD.Console.PrintWarning("Knots: {} ({:0.2f} - {:0.2f})\n".format(o.NbKnots, o.FirstParameter, o.LastParameter)) - FreeCAD.Console.PrintWarning("Mults: {}\n".format(o.getMultiplicities())) - FreeCAD.Console.PrintWarning("Periodic: {}\n".format(o.isPeriodic())) + FreeCAD.Console.PrintWarning(translate("Log", "\nBSplineCurve\n")) + FreeCAD.Console.PrintWarning(translate("Log", "Degree: {}\n")).format(o.Degree) + FreeCAD.Console.PrintWarning(translate("Log", "NbPoles: {}\n")).format(o.NbPoles) + FreeCAD.Console.PrintWarning(translate("Log", "Knots: {} ({:0.2f} - {:0.2f})\n")).format( + o.NbKnots, o.FirstParameter, o.LastParameter + ) + FreeCAD.Console.PrintWarning(translate("Log", "Mults: {}\n")).format(o.getMultiplicities()) + FreeCAD.Console.PrintWarning(translate("Log", "Periodic: {}\n")).format(o.isPeriodic()) elif isinstance(o, Part.BSplineSurface): - FreeCAD.Console.PrintWarning("\nBSplineSurface\n************\n") + FreeCAD.Console.PrintWarning(translate("Log", "\nBSplineSurface\n************\n")) try: u = o.uIso(o.UKnotSequence[0]) debug(u) except Part.OCCError: - FreeCAD.Console.PrintError("Failed to compute uIso curve\n") + FreeCAD.Console.PrintError(translate("Log", "Failed to compute uIso curve\n")) try: v = o.vIso(o.VKnotSequence[0]) debug(v) except Part.OCCError: - FreeCAD.Console.PrintError("Failed to compute vIso curve\n") - FreeCAD.Console.PrintWarning("************\n") + FreeCAD.Console.PrintError(translate("Log", "Failed to compute vIso curve\n")) + FreeCAD.Console.PrintWarning(translate("Log", "************\n")) else: - FreeCAD.Console.PrintMessage("{}\n".format(str(o))) + FreeCAD.Console.PrintMessage(translate("Log", "{}\n")).format(str(o)) def square_distance(v1, v2): diff --git a/freecad/Curves/Blending/smooth_objects.py b/freecad/Curves/Blending/smooth_objects.py index e1ff963..013887f 100644 --- a/freecad/Curves/Blending/smooth_objects.py +++ b/freecad/Curves/Blending/smooth_objects.py @@ -20,6 +20,8 @@ from .. import curves_to_surface from ..nurbs_tools import nurbs_quad +translate = FreeCAD.Qt.translate + def printError(string): FreeCAD.Console.PrintError(str(string) + "\n") @@ -1215,7 +1217,7 @@ def get_offset_curve2d(self, dist=0.1): if len(c) == 3: cos.append(c[0].toBSpline(c[1], c[2])) else: - FreeCAD.Console.PrintError("failed to extract 2D geometry") + FreeCAD.Console.PrintError(translate("Log", "failed to extract 2D geometry")) if e.isPartner(self._edge): idx = n diff --git a/freecad/Curves/Discretize.py b/freecad/Curves/Discretize.py index 117f177..04e8e9f 100644 --- a/freecad/Curves/Discretize.py +++ b/freecad/Curves/Discretize.py @@ -24,22 +24,91 @@ class Discretization: def __init__(self, obj, edge): debug("Discretization class Init") - obj.addProperty("App::PropertyLinkSub", "Edge", "Discretization", "Edge").Edge = edge - obj.addProperty("App::PropertyEnumeration", "Target", "Discretization", "Tool target").Target=["Edge","Wire"] - obj.addProperty("App::PropertyEnumeration", "Algorithm", "Method", "Discretization Method").Algorithm=["Number","QuasiNumber","Distance","Deflection","QuasiDeflection","Angular-Curvature"] - obj.addProperty("App::PropertyInteger", "Number", "Method", "Number of edge points").Number = 100 - obj.addProperty("App::PropertyFloat", "Distance", "Method", "Distance between edge points").Distance=1.0 - obj.addProperty("App::PropertyFloat", "Deflection","Method", "Distance for deflection Algorithm").Deflection=1.0 - obj.addProperty("App::PropertyFloat", "Angular", "Method", "Angular value for Angular-Curvature Algorithm").Angular=0.1 - obj.addProperty("App::PropertyFloat", "Curvature", "Method", "Curvature value for Angular-Curvature Algorithm").Curvature=0.1 - obj.addProperty("App::PropertyInteger", "Minimum", "Method", "Minimum Number of points").Minimum = 2 - obj.addProperty("App::PropertyFloat", "ParameterFirst", "Parameters", "Start parameter") - obj.addProperty("App::PropertyFloat", "ParameterLast", "Parameters", "End parameter") - obj.addProperty("App::PropertyVectorList", "Points", "Discretization", "Points") - obj.addProperty("App::PropertyFloatList", - "NormalizedParameters", - "Output", - "Normalized parameters list") + obj.addProperty( + "App::PropertyLinkSub", + "Edge", + "Discretization", + QT_TRANSLATE_NOOP("App::Property", "Edge"), + ).Edge = edge + obj.addProperty( + "App::PropertyEnumeration", + "Target", + "Discretization", + QT_TRANSLATE_NOOP("App::Property", "Tool target"), + ).Target = ["Edge", "Wire"] + obj.addProperty( + "App::PropertyEnumeration", + "Algorithm", + "Method", + QT_TRANSLATE_NOOP("App::Property", "Discretization Method"), + ).Algorithm = [ + "Number", + "QuasiNumber", + "Distance", + "Deflection", + "QuasiDeflection", + "Angular-Curvature", + ] + obj.addProperty( + "App::PropertyInteger", + "Number", + "Method", + QT_TRANSLATE_NOOP("App::Property", "Number of edge points"), + ).Number = 100 + obj.addProperty( + "App::PropertyFloat", + "Distance", + "Method", + QT_TRANSLATE_NOOP("App::Property", "Distance between edge points"), + ).Distance = 1.0 + obj.addProperty( + "App::PropertyFloat", + "Deflection", + "Method", + QT_TRANSLATE_NOOP("App::Property", "Distance for deflection Algorithm"), + ).Deflection = 1.0 + obj.addProperty( + "App::PropertyFloat", + "Angular", + "Method", + QT_TRANSLATE_NOOP("App::Property", "Angular value for Angular-Curvature Algorithm"), + ).Angular = 0.1 + obj.addProperty( + "App::PropertyFloat", + "Curvature", + "Method", + QT_TRANSLATE_NOOP("App::Property", "Curvature value for Angular-Curvature Algorithm"), + ).Curvature = 0.1 + obj.addProperty( + "App::PropertyInteger", + "Minimum", + "Method", + QT_TRANSLATE_NOOP("App::Property", "Minimum Number of points"), + ).Minimum = 2 + obj.addProperty( + "App::PropertyFloat", + "ParameterFirst", + "Parameters", + QT_TRANSLATE_NOOP("App::Property", "Start parameter"), + ) + obj.addProperty( + "App::PropertyFloat", + "ParameterLast", + "Parameters", + QT_TRANSLATE_NOOP("App::Property", "End parameter"), + ) + obj.addProperty( + "App::PropertyVectorList", + "Points", + "Discretization", + QT_TRANSLATE_NOOP("App::Property", "Points"), + ) + obj.addProperty( + "App::PropertyFloatList", + "NormalizedParameters", + "Output", + QT_TRANSLATE_NOOP("App::Property", "Normalized parameters list"), + ) obj.setEditorMode("NormalizedParameters", 1) obj.Proxy = self obj.Algorithm = "Number" @@ -256,7 +325,7 @@ def onDelete(self, feature, subelements): try: self.Object.Edge[0].ViewObject.Visibility = True except Exception as err: - FreeCAD.Console.PrintError("Error in onDelete: {0} \n".format(err)) + FreeCAD.Console.PrintError(translate("Log", "Error in onDelete: {0} \n")).format(err) return True @@ -276,7 +345,7 @@ def Activated(self): s = FreeCADGui.Selection.getSelectionEx() edges = self.parseSel(s) if not edges: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) FreeCADGui.doCommand("from freecad.Curves import Discretize") for e in edges: FreeCADGui.doCommand('obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Discretized_Edge")') diff --git a/freecad/Curves/DraftAnalysisFP.py b/freecad/Curves/DraftAnalysisFP.py index 4cc6975..7aa75f6 100644 --- a/freecad/Curves/DraftAnalysisFP.py +++ b/freecad/Curves/DraftAnalysisFP.py @@ -20,8 +20,12 @@ class DraftAnalysisProxyFP: def __init__(self, obj): - obj.addProperty("App::PropertyLink", "Source", - "AnalysisOptions", "Object on which the analysis is performed") + obj.addProperty( + "App::PropertyLink", + "Source", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Object on which the analysis is performed"), + ) obj.Proxy = self def execute(self, obj): @@ -43,30 +47,78 @@ def onChanged(self, obj, prop): class DraftAnalysisProxyVP: def __init__(self, viewobj): - viewobj.addProperty("App::PropertyVector", "Direction", - "AnalysisOptions", "Anaysis direction") - viewobj.addProperty("App::PropertyFloatConstraint", "DraftAngle1", - "AnalysisOptions", "Positive draft angle") - viewobj.addProperty("App::PropertyFloatConstraint", "DraftAngle2", - "AnalysisOptions", "Negative draft angle") - viewobj.addProperty("App::PropertyFloatConstraint", "DraftTol1", - "AnalysisOptions", "Positive draft tolerance") - viewobj.addProperty("App::PropertyFloatConstraint", "DraftTol2", - "AnalysisOptions", "Negative draft tolerance") - viewobj.addProperty("App::PropertyColor", "ColorInDraft1", - "Colors1PositiveDraft", "Color of the positive in-draft area") - viewobj.addProperty("App::PropertyColor", "ColorInTolerance1", - "Colors1PositiveDraft", "Color of the positive tolerance area") - viewobj.addProperty("App::PropertyColor", "ColorOutOfDraft1", - "Colors1PositiveDraft", "Color of the positive out-of-draft area") - viewobj.addProperty("App::PropertyColor", "ColorInDraft2", - "Colors2NegativeDraft", "Color of the negative in-draft area") - viewobj.addProperty("App::PropertyColor", "ColorInTolerance2", - "Colors2NegativeDraft", "Color of the negative tolerance area") - viewobj.addProperty("App::PropertyColor", "ColorOutOfDraft2", - "Colors2NegativeDraft", "Color of the negative out-of-draft area") - viewobj.addProperty("App::PropertyFloatConstraint", "Shading", - "AnalysisOptions", "Amount of shading on the analysis overlay") + viewobj.addProperty( + "App::PropertyVector", + "Direction", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Anaysis direction"), + ) + viewobj.addProperty( + "App::PropertyFloatConstraint", + "DraftAngle1", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Positive draft angle"), + ) + viewobj.addProperty( + "App::PropertyFloatConstraint", + "DraftAngle2", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Negative draft angle"), + ) + viewobj.addProperty( + "App::PropertyFloatConstraint", + "DraftTol1", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Positive draft tolerance"), + ) + viewobj.addProperty( + "App::PropertyFloatConstraint", + "DraftTol2", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Negative draft tolerance"), + ) + viewobj.addProperty( + "App::PropertyColor", + "ColorInDraft1", + "Colors1PositiveDraft", + QT_TRANSLATE_NOOP("App::Property", "Color of the positive in-draft area"), + ) + viewobj.addProperty( + "App::PropertyColor", + "ColorInTolerance1", + "Colors1PositiveDraft", + QT_TRANSLATE_NOOP("App::Property", "Color of the positive tolerance area"), + ) + viewobj.addProperty( + "App::PropertyColor", + "ColorOutOfDraft1", + "Colors1PositiveDraft", + QT_TRANSLATE_NOOP("App::Property", "Color of the positive out-of-draft area"), + ) + viewobj.addProperty( + "App::PropertyColor", + "ColorInDraft2", + "Colors2NegativeDraft", + QT_TRANSLATE_NOOP("App::Property", "Color of the negative in-draft area"), + ) + viewobj.addProperty( + "App::PropertyColor", + "ColorInTolerance2", + "Colors2NegativeDraft", + QT_TRANSLATE_NOOP("App::Property", "Color of the negative tolerance area"), + ) + viewobj.addProperty( + "App::PropertyColor", + "ColorOutOfDraft2", + "Colors2NegativeDraft", + QT_TRANSLATE_NOOP("App::Property", "Color of the negative out-of-draft area"), + ) + viewobj.addProperty( + "App::PropertyFloatConstraint", + "Shading", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Amount of shading on the analysis overlay"), + ) viewobj.DraftAngle1 = (1.0, 0.0, 90.0, 0.1) viewobj.DraftAngle2 = (1.0, 0.0, 90.0, 0.1) viewobj.DraftTol1 = (0.05, 0.0, 90.0, 0.05) diff --git a/freecad/Curves/FC_interaction_example.py b/freecad/Curves/FC_interaction_example.py index 2b39bad..2b81bf6 100644 --- a/freecad/Curves/FC_interaction_example.py +++ b/freecad/Curves/FC_interaction_example.py @@ -9,6 +9,9 @@ from PySide2.QtGui import QColor from pivy import quarter, coin, graphics, utils +translate = FreeCAD.Qt.translate + + class ConnectionMarker(graphics.Marker): def __init__(self, points): super(ConnectionMarker, self).__init__(points, True) @@ -133,7 +136,7 @@ def __init__(self, points=[], fp = None): elif isinstance(points[0],(tuple,list)): self.points = [MarkerOnEdge([p]) for p in points] else: - FreeCAD.Console.PrintError("InterpolationPolygon : bad input") + FreeCAD.Console.PrintError(translate("Log", "InterpolationPolygon : bad input")) # Setup coin objects if not FreeCAD.ActiveDocument: @@ -171,7 +174,7 @@ def update_curve(self): FreeCAD.Console.PrintMessage("pts :\n%s\n"%str(pts)) if len(pts) > 1: self.curve.interpolate(pts) - #FreeCAD.Console.PrintMessage("update_curve\n") + #FreeCAD.Console.PrintMessage(translate("Log", "update_curve\n")) if self.fp: self.fp.Shape = self.curve.toShape() diff --git a/freecad/Curves/FaceMapFP.py b/freecad/Curves/FaceMapFP.py index 8c1a8d0..937af08 100644 --- a/freecad/Curves/FaceMapFP.py +++ b/freecad/Curves/FaceMapFP.py @@ -13,7 +13,9 @@ from freecad.Curves.nurbs_tools import nurbs_quad from freecad.Curves import ICONPATH -TOOL_ICON = os.path.join(ICONPATH, 'icon.svg') +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +TOOL_ICON = os.path.join(ICONPATH, "icon.svg") # debug = _utils.debug # debug = _utils.doNothing @@ -71,14 +73,30 @@ class FaceMapFP: """Creates a ...""" def __init__(self, obj): """Add the properties""" - obj.addProperty("App::App::PropertyLinkSub", "Source", - "Base", "Input face") - obj.addProperty("App::PropertyFloat", "SizeU", - "Dimensions", "Size of the map in the U direction") - obj.addProperty("App::PropertyFloat", "SizeV", - "Dimensions", "Size of the map in the V direction") - obj.addProperty("App::PropertyBool", "AddBounds", - "Settings", "Add the bounding box of the face") + obj.addProperty( + "App::App::PropertyLinkSub", + "Source", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Input face"), + ) + obj.addProperty( + "App::PropertyFloat", + "SizeU", + "Dimensions", + QT_TRANSLATE_NOOP("App::Property", "Size of the map in the U direction"), + ) + obj.addProperty( + "App::PropertyFloat", + "SizeV", + "Dimensions", + QT_TRANSLATE_NOOP("App::Property", "Size of the map in the V direction"), + ) + obj.addProperty( + "App::PropertyBool", + "AddBounds", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Add the bounding box of the face"), + ) obj.SizeU = 1.0 obj.SizeV = 1.0 obj.Proxy = self @@ -136,7 +154,7 @@ def makeFeature(self, sel=None): def Activated(self): sel = FreeCADGui.Selection.getSelection() if sel == []: - FreeCAD.Console.PrintError("Select something first !\n") + FreeCAD.Console.PrintError(translate("Log", "Select something first !\n")) else: self.makeFeature(sel) diff --git a/freecad/Curves/FlattenFP.py b/freecad/Curves/FlattenFP.py index a670e96..70f0628 100644 --- a/freecad/Curves/FlattenFP.py +++ b/freecad/Curves/FlattenFP.py @@ -352,12 +352,24 @@ def flatten_face_new(face, inPlace=False, size=0.0): class FlattenProxy: def __init__(self, obj): """Add the properties""" - obj.addProperty("App::PropertyLinkSub", "Source", - "Source", "The conical face to flatten") - obj.addProperty("App::PropertyBool", "InPlace", - "Settings", "Unroll the face in place") - obj.addProperty("App::PropertyFloat", "Size", - "Settings", "Size of the underlying surface") + obj.addProperty( + "App::PropertyLinkSub", + "Source", + "Source", + QT_TRANSLATE_NOOP("App::Property", "The conical face to flatten"), + ) + obj.addProperty( + "App::PropertyBool", + "InPlace", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Unroll the face in place"), + ) + obj.addProperty( + "App::PropertyFloat", + "Size", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Size of the underlying surface"), + ) obj.setEditorMode("Size", 2) obj.Size = 0.0 preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Curves") @@ -402,14 +414,16 @@ def makeFeature(self, sel=None): def Activated(self): sel = FreeCADGui.Selection.getSelectionEx() if sel == []: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) for so in sel: for sn in so.SubElementNames: subo = so.Object.getSubObject(sn) if hasattr(subo, "Surface") and isinstance(subo.Surface, (Part.Cylinder, Part.Cone, Part.SurfaceOfExtrusion)): self.makeFeature((so.Object, sn)) else: - FreeCAD.Console.PrintError("Bad input :{}-{}\n".format(so.Object.Label, sn)) + FreeCAD.Console.PrintError(translate("Log", "Bad input :{}-{}\n")).format( + so.Object.Label, sn + ) def IsActive(self): if FreeCAD.ActiveDocument: diff --git a/freecad/Curves/GeomInfo.py b/freecad/Curves/GeomInfo.py index 45df632..b710d4e 100644 --- a/freecad/Curves/GeomInfo.py +++ b/freecad/Curves/GeomInfo.py @@ -27,7 +27,7 @@ def debug(string): if DEBUG: FreeCAD.Console.PrintMessage(string) - FreeCAD.Console.PrintMessage("\n") + FreeCAD.Console.PrintMessage(translate("Log", "\n")) def beautify(shp): @@ -466,7 +466,7 @@ def setPreselection(self, doc, obj, sub): pass def clearSelection(self, doc): # If screen is clicked, delete selection - # FreeCAD.Console.PrintMessage("clearSelection\n") + # FreeCAD.Console.PrintMessage(translate("Log", "clearSelection\n")) if self.Active: self.SoText2.string = "" self.removeGrid() diff --git a/freecad/Curves/HQRuledSurfaceFP.py b/freecad/Curves/HQRuledSurfaceFP.py index a47a8f2..50de2a1 100644 --- a/freecad/Curves/HQRuledSurfaceFP.py +++ b/freecad/Curves/HQRuledSurfaceFP.py @@ -19,9 +19,11 @@ from freecad.Curves import _utils from freecad.Curves import ICONPATH -TOOL_ICON = os.path.join( ICONPATH, 'ruled_surface.svg') -#debug = _utils.debug -#debug = _utils.doNothing +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +TOOL_ICON = os.path.join(ICONPATH, "ruled_surface.svg") +# debug = _utils.debug +# debug = _utils.doNothing props = """ App::PropertyBool @@ -76,14 +78,54 @@ class HQ_Ruled_SurfaceFP: """Creates a ...""" def __init__(self, obj, sources): """Add the properties""" - obj.addProperty("App::PropertyLinkList", "SourceObjects", "HQ_Ruled_Surface", "SourceObjects") - obj.addProperty("App::PropertyLinkSubList", "SourceShapes", "HQ_Ruled_Surface", "SourceShapes") - obj.addProperty("App::PropertyInteger", "Samples", "HQ_Ruled_Surface", "Number of orthogonal samples").Samples = 20 - obj.addProperty("App::PropertyFloatConstraint","SmoothingFactorStart", "HQ_Ruled_Surface", "Smoothing factor on curve start") - obj.addProperty("App::PropertyFloatConstraint","SmoothingFactorEnd", "HQ_Ruled_Surface", "Smoothing factor on curve end") - obj.addProperty("App::PropertyInteger", "Method", "HQ_Ruled_Surface", "Projection method (1,2,3,4)").Method = 3 - obj.addProperty("App::PropertyFloat", "Tol3D", "HQ_Ruled_Surface", "3D tolerance").Tol3D = 1e-5 - obj.addProperty("App::PropertyFloat", "Tol2D", "HQ_Ruled_Surface", "Parametric tolerance").Tol2D = 1e-8 + obj.addProperty( + "App::PropertyLinkList", + "SourceObjects", + "HQ_Ruled_Surface", + QT_TRANSLATE_NOOP("App::Property", "SourceObjects"), + ) + obj.addProperty( + "App::PropertyLinkSubList", + "SourceShapes", + "HQ_Ruled_Surface", + QT_TRANSLATE_NOOP("App::Property", "SourceShapes"), + ) + obj.addProperty( + "App::PropertyInteger", + "Samples", + "HQ_Ruled_Surface", + QT_TRANSLATE_NOOP("App::Property", "Number of orthogonal samples"), + ).Samples = 20 + obj.addProperty( + "App::PropertyFloatConstraint", + "SmoothingFactorStart", + "HQ_Ruled_Surface", + QT_TRANSLATE_NOOP("App::Property", "Smoothing factor on curve start"), + ) + obj.addProperty( + "App::PropertyFloatConstraint", + "SmoothingFactorEnd", + "HQ_Ruled_Surface", + QT_TRANSLATE_NOOP("App::Property", "Smoothing factor on curve end"), + ) + obj.addProperty( + "App::PropertyInteger", + "Method", + "HQ_Ruled_Surface", + QT_TRANSLATE_NOOP("App::Property", "Projection method (1,2,3,4)"), + ).Method = 3 + obj.addProperty( + "App::PropertyFloat", + "Tol3D", + "HQ_Ruled_Surface", + QT_TRANSLATE_NOOP("App::Property", "3D tolerance"), + ).Tol3D = 1e-5 + obj.addProperty( + "App::PropertyFloat", + "Tol2D", + "HQ_Ruled_Surface", + QT_TRANSLATE_NOOP("App::Property", "Parametric tolerance"), + ).Tol2D = 1e-8 obj.SmoothingFactorStart = (0.2, 0.0, 0.5, 0.05) obj.SmoothingFactorEnd = (0.2, 0.0, 0.5, 0.05) objs = [] @@ -174,7 +216,7 @@ def Activated(self): edges.append(so.Object) if len(edges) < 1: - FreeCAD.Console.PrintError("Select something first !\n") + FreeCAD.Console.PrintError(translate("Log", "Select something first !\n")) else: self.makeFeature(edges) diff --git a/freecad/Curves/HelicalSweepFP.py b/freecad/Curves/HelicalSweepFP.py index 74d30ca..5d1fae3 100644 --- a/freecad/Curves/HelicalSweepFP.py +++ b/freecad/Curves/HelicalSweepFP.py @@ -20,9 +20,10 @@ from freecad.Curves import ICONPATH -TOOL_ICON = os.path.join( ICONPATH, 'helical_sweep.svg') -#debug = _utils.debug -#debug = _utils.doNothing +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +TOOL_ICON = os.path.join(ICONPATH, "helical_sweep.svg") +# debug = _utils.debug +# debug = _utils.doNothing props = """ App::PropertyBool @@ -177,10 +178,30 @@ class HelicalSweepFP: def __init__(self, obj): """Add the properties""" obj.addProperty("App::PropertyLink", "Profile", "Profile object") - obj.addProperty("App::PropertyFloat", "Turns", "Settings", "Number of turns").Turns = 1.0 - obj.addProperty("App::PropertyFloat", "Lead", "Settings", "Thread lead (-1 for auto)").Lead = -1 - obj.addProperty("App::PropertyBool", "Rational", "Settings", "Allow rational bsplines").Rational = False - obj.addProperty("App::PropertyBool", "Solid", "Settings", "Create a solid shape").Solid = False + obj.addProperty( + "App::PropertyFloat", + "Turns", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Number of turns"), + ).Turns = 1.0 + obj.addProperty( + "App::PropertyFloat", + "Lead", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Thread lead (-1 for auto)"), + ).Lead = -1 + obj.addProperty( + "App::PropertyBool", + "Rational", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Allow rational bsplines"), + ).Rational = False + obj.addProperty( + "App::PropertyBool", + "Solid", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Create a solid shape"), + ).Solid = False obj.Proxy = self def execute(self, obj): diff --git a/freecad/Curves/IsoCurve.py b/freecad/Curves/IsoCurve.py index cc3893c..9b35c89 100644 --- a/freecad/Curves/IsoCurve.py +++ b/freecad/Curves/IsoCurve.py @@ -23,7 +23,8 @@ from freecad.Curves import _utils from freecad.Curves import ICONPATH -TOOL_ICON = os.path.join(ICONPATH, 'isocurve.svg') +QT_TRANSLATE_NOOP = App.Qt.QT_TRANSLATE_NOOP +TOOL_ICON = os.path.join(ICONPATH, "isocurve.svg") # debug = _utils.debug debug = _utils.doNothing @@ -41,12 +42,42 @@ class IsoCurve: "The IsoCurve feature object" def __init__(self, selfobj): - selfobj.addProperty("App::PropertyLinkSub", "Face", "IsoCurve", "Input face") - selfobj.addProperty("App::PropertyFloat", "Parameter", "IsoCurve", "IsoCurve parameter").Parameter = 0. - selfobj.addProperty("App::PropertyInteger", "NumberU", "IsoCurve", "Number of IsoCurve in U direction").NumberU = 5 - selfobj.addProperty("App::PropertyInteger", "NumberV", "IsoCurve", "Number of IsoCurve in V direction").NumberV = 5 - selfobj.addProperty("App::PropertyEnumeration", "Mode", "IsoCurve", "Number of IsoCurve").Mode = ["Single", "Multi"] - selfobj.addProperty("App::PropertyEnumeration", "Orientation", "IsoCurve", "Curve Orientation").Orientation = ["U", "V"] + selfobj.addProperty( + "App::PropertyLinkSub", + "Face", + "IsoCurve", + QT_TRANSLATE_NOOP("App::Property", "Input face"), + ) + selfobj.addProperty( + "App::PropertyFloat", + "Parameter", + "IsoCurve", + QT_TRANSLATE_NOOP("App::Property", "IsoCurve parameter"), + ).Parameter = 0.0 + selfobj.addProperty( + "App::PropertyInteger", + "NumberU", + "IsoCurve", + QT_TRANSLATE_NOOP("App::Property", "Number of IsoCurve in U direction"), + ).NumberU = 5 + selfobj.addProperty( + "App::PropertyInteger", + "NumberV", + "IsoCurve", + QT_TRANSLATE_NOOP("App::Property", "Number of IsoCurve in V direction"), + ).NumberV = 5 + selfobj.addProperty( + "App::PropertyEnumeration", + "Mode", + "IsoCurve", + QT_TRANSLATE_NOOP("App::Property", "Number of IsoCurve"), + ).Mode = ["Single", "Multi"] + selfobj.addProperty( + "App::PropertyEnumeration", + "Orientation", + "IsoCurve", + QT_TRANSLATE_NOOP("App::Property", "Curve Orientation"), + ).Orientation = ["U", "V"] selfobj.Mode = "Multi" selfobj.setEditorMode("Parameter", 2) selfobj.setEditorMode("Orientation", 2) diff --git a/freecad/Curves/JoinCurves.py b/freecad/Curves/JoinCurves.py index 015df04..dfe615a 100644 --- a/freecad/Curves/JoinCurves.py +++ b/freecad/Curves/JoinCurves.py @@ -81,15 +81,55 @@ def forceClosed(curves, tol=1e-7): class join: "joins the selected edges into a single BSpline Curve" def __init__(self, obj): - ''' Add the properties ''' - obj.addProperty("App::PropertyLinkSubList", "Edges", "InputSources", "List of edges to join") - obj.addProperty("App::PropertyLink", "Base", "InputSources", "Join all the edges of this base object") - obj.addProperty("App::PropertyFloat", "Tolerance", "Join", "Tolerance").Tolerance = 0.01 - obj.addProperty("App::PropertyBool", "CornerBreak", "Join", "Break on sharp corners").CornerBreak = False - obj.addProperty("App::PropertyBool", "ForceContact", "Join", "Force connection of edges").ForceContact = True - obj.addProperty("App::PropertyBool", "ForceClosed", "Join", "Force closed curve").ForceClosed = False - obj.addProperty("App::PropertyBool", "Reverse", "Join", "Reverse the output curve").Reverse = False - obj.addProperty("App::PropertyInteger", "StartOffset", "Join", "Set the start point of closed curve").StartOffset = 0 + """Add the properties""" + obj.addProperty( + "App::PropertyLinkSubList", + "Edges", + "InputSources", + QT_TRANSLATE_NOOP("App::Property", "List of edges to join"), + ) + obj.addProperty( + "App::PropertyLink", + "Base", + "InputSources", + QT_TRANSLATE_NOOP("App::Property", "Join all the edges of this base object"), + ) + obj.addProperty( + "App::PropertyFloat", + "Tolerance", + "Join", + QT_TRANSLATE_NOOP("App::Property", "Tolerance"), + ).Tolerance = 0.01 + obj.addProperty( + "App::PropertyBool", + "CornerBreak", + "Join", + QT_TRANSLATE_NOOP("App::Property", "Break on sharp corners"), + ).CornerBreak = False + obj.addProperty( + "App::PropertyBool", + "ForceContact", + "Join", + QT_TRANSLATE_NOOP("App::Property", "Force connection of edges"), + ).ForceContact = True + obj.addProperty( + "App::PropertyBool", + "ForceClosed", + "Join", + QT_TRANSLATE_NOOP("App::Property", "Force closed curve"), + ).ForceClosed = False + obj.addProperty( + "App::PropertyBool", + "Reverse", + "Join", + QT_TRANSLATE_NOOP("App::Property", "Reverse the output curve"), + ).Reverse = False + obj.addProperty( + "App::PropertyInteger", + "StartOffset", + "Join", + QT_TRANSLATE_NOOP("App::Property", "Set the start point of closed curve"), + ).StartOffset = 0 obj.Proxy = self def onChanged(self, fp, prop): @@ -232,7 +272,7 @@ def Activated(self): except AttributeError: pass if sel == []: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) for selobj in sel: if selobj.HasSubObjects: for i in range(len(selobj.SubObjects)): diff --git a/freecad/Curves/Outline_FP.py b/freecad/Curves/Outline_FP.py index fcfd4c0..ca49d09 100644 --- a/freecad/Curves/Outline_FP.py +++ b/freecad/Curves/Outline_FP.py @@ -15,9 +15,11 @@ import _utils import approximate_extension -TOOL_ICON = _utils.iconsPath() + 'icon.svg' -#debug = _utils.debug -#debug = _utils.doNothing +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +TOOL_ICON = _utils.iconsPath() + "icon.svg" +# debug = _utils.debug +# debug = _utils.doNothing props = """ App::PropertyBool @@ -72,9 +74,9 @@ class OutlineFP: """Creates a Outline curve""" def __init__(self, obj, s): """Add the properties""" - obj.addProperty("App::PropertyLink", "Source", "Outline", "Source object").Source = s - obj.addProperty("App::PropertyVector", "Direction", "Outline", "Direction Vector").Direction = FreeCAD.Vector(0,0,1) - obj.addProperty("App::PropertyInteger", "RadialSamples", "Outline", "Number of samples around object").RadialSamples = 360 + obj.addProperty("App::PropertyLink", "Source", "Outline", QT_TRANSLATE_NOOP("App::Property", "Source object")).Source = s + obj.addProperty("App::PropertyVector", "Direction", "Outline", QT_TRANSLATE_NOOP("App::Property", "Direction Vector")).Direction = FreeCAD.Vector(0,0,1) + obj.addProperty("App::PropertyInteger", "RadialSamples", "Outline", QT_TRANSLATE_NOOP("App::Property", "Number of samples around object")).RadialSamples = 360 obj.Proxy = self def execute(self, obj): @@ -151,7 +153,7 @@ def makeFeature(self,sel): def Activated(self): sel = FreeCADGui.Selection.getSelection() if sel == []: - FreeCAD.Console.PrintError("Select something first !\n") + FreeCAD.Console.PrintError(translate("Log", "Select something first !\n")) else: self.makeFeature(sel[0]) diff --git a/freecad/Curves/ParametricBlendCurve.py b/freecad/Curves/ParametricBlendCurve.py index 27902e9..a7503bf 100644 --- a/freecad/Curves/ParametricBlendCurve.py +++ b/freecad/Curves/ParametricBlendCurve.py @@ -30,22 +30,83 @@ class BlendCurveFP: def __init__(self, obj, edges): debug("BlendCurve class Init") - obj.addProperty("App::PropertyLinkSub", "Edge1", "Edge1", "Edge 1").Edge1 = edges[0] - obj.addProperty("App::PropertyLinkSub", "Edge2", "Edge2", "Edge 2").Edge2 = edges[1] - # obj.addProperty("App::PropertyInteger", "DegreeMax", "BlendCurve", "Max degree of the Blend curve").DegreeMax = 9 - obj.addProperty("App::PropertyDistance", "Parameter1", "Edge1", "Location on first edge") - obj.addProperty("App::PropertyBool", "Reverse1", "Edge1", "Reverse Edge").Reverse1 = False - obj.addProperty("App::PropertyFloatConstraint", "Scale1", "Edge1", "Scale of blend curve") - obj.addProperty("App::PropertyEnumeration", "Continuity1", "Edge1", "Continuity").Continuity1 = ["C0", "G1", "G2", "G3", "G4"] - obj.addProperty("App::PropertyDistance", "Parameter2", "Edge2", "Location on second edge") - obj.addProperty("App::PropertyBool", "Reverse2", "Edge2", "Reverse Edge").Reverse2 = False - obj.addProperty("App::PropertyFloatConstraint", "Scale2", "Edge2", "Scale of blend curve") - obj.addProperty("App::PropertyEnumeration", "Continuity2", "Edge2", "Continuity").Continuity2 = ["C0", "G1", "G2", "G3", "G4"] - obj.addProperty("App::PropertyVectorList", "CurvePts", "BlendCurve", "Poles of the Bezier curve") - obj.addProperty("App::PropertyEnumeration", "Output", "BlendCurve", "Output type").Output = ["Wire", "Joined", "Single"] - obj.addProperty("App::PropertyBool", "AutoScale", "BlendCurve", "Compute scales to get minimal curvature along curve").AutoScale = False - obj.Scale1 = (1., -5.0, 5.0, 0.05) - obj.Scale2 = (1., -5.0, 5.0, 0.05) + obj.addProperty( + "App::PropertyLinkSub", "Edge1", "Edge1", QT_TRANSLATE_NOOP("App::Property", "Edge 1") + ).Edge1 = edges[0] + obj.addProperty( + "App::PropertyLinkSub", "Edge2", "Edge2", QT_TRANSLATE_NOOP("App::Property", "Edge 2") + ).Edge2 = edges[1] + # obj.addProperty("App::PropertyInteger", "DegreeMax", "BlendCurve", QT_TRANSLATE_NOOP("App::Property", "Max degree of the Blend curve")).DegreeMax = 9 + obj.addProperty( + "App::PropertyDistance", + "Parameter1", + "Edge1", + QT_TRANSLATE_NOOP("App::Property", "Location on first edge"), + ) + obj.addProperty( + "App::PropertyBool", + "Reverse1", + "Edge1", + QT_TRANSLATE_NOOP("App::Property", "Reverse Edge"), + ).Reverse1 = False + obj.addProperty( + "App::PropertyFloatConstraint", + "Scale1", + "Edge1", + QT_TRANSLATE_NOOP("App::Property", "Scale of blend curve"), + ) + obj.addProperty( + "App::PropertyEnumeration", + "Continuity1", + "Edge1", + QT_TRANSLATE_NOOP("App::Property", "Continuity"), + ).Continuity1 = ["C0", "G1", "G2", "G3", "G4"] + obj.addProperty( + "App::PropertyDistance", + "Parameter2", + "Edge2", + QT_TRANSLATE_NOOP("App::Property", "Location on second edge"), + ) + obj.addProperty( + "App::PropertyBool", + "Reverse2", + "Edge2", + QT_TRANSLATE_NOOP("App::Property", "Reverse Edge"), + ).Reverse2 = False + obj.addProperty( + "App::PropertyFloatConstraint", + "Scale2", + "Edge2", + QT_TRANSLATE_NOOP("App::Property", "Scale of blend curve"), + ) + obj.addProperty( + "App::PropertyEnumeration", + "Continuity2", + "Edge2", + QT_TRANSLATE_NOOP("App::Property", "Continuity"), + ).Continuity2 = ["C0", "G1", "G2", "G3", "G4"] + obj.addProperty( + "App::PropertyVectorList", + "CurvePts", + "BlendCurve", + QT_TRANSLATE_NOOP("App::Property", "Poles of the Bezier curve"), + ) + obj.addProperty( + "App::PropertyEnumeration", + "Output", + "BlendCurve", + QT_TRANSLATE_NOOP("App::Property", "Output type"), + ).Output = ["Wire", "Joined", "Single"] + obj.addProperty( + "App::PropertyBool", + "AutoScale", + "BlendCurve", + QT_TRANSLATE_NOOP( + "App::Property", "Compute scales to get minimal curvature along curve" + ), + ).AutoScale = False + obj.Scale1 = (1.0, -5.0, 5.0, 0.05) + obj.Scale2 = (1.0, -5.0, 5.0, 0.05) obj.setEditorMode("CurvePts", 2) obj.Proxy = self @@ -53,7 +114,11 @@ def check_minimize(self, fp): if blend_curve.CAN_MINIMIZE: fp.setEditorMode("AutoScale", 0) else: - FreeCAD.Console.PrintWarning("BlendCurve: Install 'scipy' python package for AutoScale feature\n") + FreeCAD.Console.PrintWarning( + translate( + "Log", "BlendCurve: Install 'scipy' python package for AutoScale feature\n" + ) + ) fp.setEditorMode("AutoScale", 2) def getShape(self, fp, prop): @@ -236,7 +301,7 @@ def __init__(self, points=[], fp=None): elif isinstance(p, manipulators.CustomText): self.points.append(p) else: - FreeCAD.Console.PrintError("pointEditor : bad input") + FreeCAD.Console.PrintError(translate("Log", "pointEditor : bad input")) for p in points: if hasattr(p, "ctrl_keys"): for key in p.ctrl_keys: diff --git a/freecad/Curves/ParametricComb.py b/freecad/Curves/ParametricComb.py index 75c8d08..954bbcf 100644 --- a/freecad/Curves/ParametricComb.py +++ b/freecad/Curves/ParametricComb.py @@ -172,22 +172,22 @@ def __init__(self, obj , edge): ''' Add the properties ''' debug("Comb class Init") obj.addProperty("App::PropertyLinkSubList", "Edge", - "Comb", "Edge").Edge = edge - # obj.addProperty("App::PropertyEnumeration","Type","Comb","Comb Type").Type=["Curvature","Unit Normal"] + "Comb", QT_TRANSLATE_NOOP("App::Property", "Edge")).Edge = edge + # obj.addProperty("App::PropertyEnumeration","Type","Comb",QT_TRANSLATE_NOOP("App::Property", "Comb Type")).Type=["Curvature","Unit Normal"] obj.addProperty("App::PropertyFloat", "Scale", - "Comb", "Scale (%). 0 for AutoScale").Scale = 0.0 - # obj.addProperty("App::PropertyBool","ScaleAuto","Comb","Automatic Scale").ScaleAuto = True + "Comb", QT_TRANSLATE_NOOP("App::Property", "Scale (%). 0 for AutoScale")).Scale = 0.0 + # obj.addProperty("App::PropertyBool","ScaleAuto","Comb",QT_TRANSLATE_NOOP("App::Property", "Automatic Scale")).ScaleAuto = True obj.addProperty("App::PropertyIntegerConstraint", "Samples", - "Comb", "Number of samples").Samples = 100 + "Comb", QT_TRANSLATE_NOOP("App::Property", "Number of samples")).Samples = 100 obj.addProperty("App::PropertyInteger", "Number", - "Surface", "Number of surface samples").Number = 3 + "Surface", QT_TRANSLATE_NOOP("App::Property", "Number of surface samples")).Number = 3 obj.addProperty("App::PropertyEnumeration", "Orientation", - "Surface", "Surface Comb Orientation").Orientation = ["U", "V", "UV"] - # obj.addProperty("App::PropertyFloat","TotalLength","Comb","Total length of edges") + "Surface", QT_TRANSLATE_NOOP("App::Property", "Surface Comb Orientation")).Orientation = ["U", "V", "UV"] + # obj.addProperty("App::PropertyFloat","TotalLength","Comb",QT_TRANSLATE_NOOP("App::Property", "Total length of edges")) obj.addProperty("App::PropertyVectorList", "CombPoints", - "Comb", "CombPoints") + "Comb", QT_TRANSLATE_NOOP("App::Property", "CombPoints")) obj.addProperty("Part::PropertyPartShape", "Shape", - "Comb", "Shape of comb plot") + "Comb", QT_TRANSLATE_NOOP("App::Property", "Shape of comb plot")) obj.Proxy = self # obj.Samples = (20,2,1000,10) obj.CombPoints = [] @@ -396,9 +396,9 @@ class ViewProviderComb: def __init__(self, obj): "Set this object to the proxy object of the actual view provider" obj.addProperty("App::PropertyColor", "CurveColor", - "Comb", "Color of the curvature curve").CurveColor = (0.8, 0.0, 0.0) + "Comb", QT_TRANSLATE_NOOP("App::Property", "Color of the curvature curve")).CurveColor = (0.8, 0.0, 0.0) obj.addProperty("App::PropertyColor", "CombColor", - "Comb", "Color of the curvature comb").CombColor = (0.0, 0.8, 0.0) + "Comb", QT_TRANSLATE_NOOP("App::Property", "Color of the curvature comb")).CombColor = (0.0, 0.8, 0.0) self.Object = obj.Object obj.Proxy = self @@ -466,16 +466,16 @@ def loc_cb(self, event_callback): def setEdit(self, vobj, mode=0): if mode == 0: - FreeCAD.Console.PrintWarning("--- Entering Comb Edit Mode ---\n") - FreeCAD.Console.PrintMessage("Nb of samples : CTRL + Mouse Up / Down\n") - FreeCAD.Console.PrintMessage("Comb scale : SHIFT + Mouse Up / Down\n") + FreeCAD.Console.PrintWarning(translate("Log", "--- Entering Comb Edit Mode ---\n")) + FreeCAD.Console.PrintMessage(translate("Log", "Nb of samples : CTRL + Mouse Up / Down\n")) + FreeCAD.Console.PrintMessage(translate("Log", "Comb scale : SHIFT + Mouse Up / Down\n")) self.view = FreeCADGui.ActiveDocument.ActiveView self.locCB = self.view.addEventCallbackPivy(coin.SoLocation2Event.getClassTypeId(), self.loc_cb) return True return False def unsetEdit(self, vobj, mode=0): - FreeCAD.Console.PrintWarning("--- Exiting Comb Edit Mode ---\n") + FreeCAD.Console.PrintWarning(translate("Log", "--- Exiting Comb Edit Mode ---\n")) self.view.removeEventCallbackPivy(coin.SoLocation2Event.getClassTypeId(), self.locCB) return False diff --git a/freecad/Curves/PlateSurface.py b/freecad/Curves/PlateSurface.py index 6b7a61c..5044950 100644 --- a/freecad/Curves/PlateSurface.py +++ b/freecad/Curves/PlateSurface.py @@ -12,7 +12,7 @@ def debug(string): if DEBUG: FreeCAD.Console.PrintMessage(string) - FreeCAD.Console.PrintMessage("\n") + FreeCAD.Console.PrintMessage(translate("Log", "\n")) def linkSubList_convertToOldStyle(references): @@ -36,25 +36,25 @@ def __init__(self, obj): debug("\nplateSurfFP class init\n") # List of constraint objects - obj.addProperty("App::PropertyLinkList", "Objects", "Plate", "List of constraint objects") + obj.addProperty("App::PropertyLinkList", "Objects", "Plate", QT_TRANSLATE_NOOP("App::Property", "List of constraint objects")) # Arguments of the PlateSurface algorithm - obj.addProperty("App::PropertyIntegerConstraint", "PlateDegree", "Plate", "Plate degree") - obj.addProperty("App::PropertyIntegerConstraint", "Iterations", "Plate", "Number of iterations") - obj.addProperty("App::PropertyFloat", "Tol2d", "Plate", "2D Tolerance") - obj.addProperty("App::PropertyFloat", "Tol3d", "Plate", "3D Tolerance") - obj.addProperty("App::PropertyFloat", "TolAngular", "Plate", "Angular Tolerance").TolAngular = 0.1 - obj.addProperty("App::PropertyFloat", "TolCurvature", "Plate", "Curvature Tolerance").TolCurvature = 0.1 - obj.addProperty("App::PropertyBool", "Anisotropie", "Plate", "Anisotropie").Anisotropie = False + obj.addProperty("App::PropertyIntegerConstraint", "PlateDegree", "Plate", QT_TRANSLATE_NOOP("App::Property", "Plate degree")) + obj.addProperty("App::PropertyIntegerConstraint", "Iterations", "Plate", QT_TRANSLATE_NOOP("App::Property", "Number of iterations")) + obj.addProperty("App::PropertyFloat", "Tol2d", "Plate", QT_TRANSLATE_NOOP("App::Property", "2D Tolerance")) + obj.addProperty("App::PropertyFloat", "Tol3d", "Plate", QT_TRANSLATE_NOOP("App::Property", "3D Tolerance")) + obj.addProperty("App::PropertyFloat", "TolAngular", "Plate", QT_TRANSLATE_NOOP("App::Property", "Angular Tolerance")).TolAngular = 0.1 + obj.addProperty("App::PropertyFloat", "TolCurvature", "Plate", QT_TRANSLATE_NOOP("App::Property", "Curvature Tolerance")).TolCurvature = 0.1 + obj.addProperty("App::PropertyBool", "Anisotropie", "Plate", QT_TRANSLATE_NOOP("App::Property", "Anisotropie")).Anisotropie = False # Arguments of the BSpline approximation - obj.addProperty("App::PropertyIntegerConstraint", "MaxDegree", "SurfaceApproximation", "Max degree of Bspline approximation") - obj.addProperty("App::PropertyIntegerConstraint", "MaxSegments", "SurfaceApproximation", "Max Number of surface segments") - obj.addProperty("App::PropertyFloat", "MaxDistance", "SurfaceApproximation", "Max Distance to plate surface").MaxDistance = 0.001 - obj.addProperty("App::PropertyFloat", "Tolerance", "SurfaceApproximation", "3D Tolerance of Bspline approximation").Tolerance = 0.01 - obj.addProperty("App::PropertyIntegerConstraint", "CritOrder", "SurfaceApproximation", "Criterion Order") - obj.addProperty("App::PropertyEnumeration", "Continuity", "SurfaceApproximation", "Desired continuity of the surface").Continuity=["C0","C1","C2"] - obj.addProperty("App::PropertyFloat", "EnlargeCoeff", "SurfaceApproximation", "Enlarge Coefficient").EnlargeCoeff = 1.1 + obj.addProperty("App::PropertyIntegerConstraint", "MaxDegree", "SurfaceApproximation", QT_TRANSLATE_NOOP("App::Property", "Max degree of Bspline approximation")) + obj.addProperty("App::PropertyIntegerConstraint", "MaxSegments", "SurfaceApproximation", QT_TRANSLATE_NOOP("App::Property", "Max Number of surface segments")) + obj.addProperty("App::PropertyFloat", "MaxDistance", "SurfaceApproximation", QT_TRANSLATE_NOOP("App::Property", "Max Distance to plate surface")).MaxDistance = 0.001 + obj.addProperty("App::PropertyFloat", "Tolerance", "SurfaceApproximation", QT_TRANSLATE_NOOP("App::Property", "3D Tolerance of Bspline approximation")).Tolerance = 0.01 + obj.addProperty("App::PropertyIntegerConstraint", "CritOrder", "SurfaceApproximation", QT_TRANSLATE_NOOP("App::Property", "Criterion Order")) + obj.addProperty("App::PropertyEnumeration", "Continuity", "SurfaceApproximation", QT_TRANSLATE_NOOP("App::Property", "Desired continuity of the surface")).Continuity=["C0","C1","C2"] + obj.addProperty("App::PropertyFloat", "EnlargeCoeff", "SurfaceApproximation", QT_TRANSLATE_NOOP("App::Property", "Enlarge Coefficient")).EnlargeCoeff = 1.1 obj.Proxy = self obj.PlateDegree = ( 3, 3, 25, 1) diff --git a/freecad/Curves/PointInterpolation.py b/freecad/Curves/PointInterpolation.py index eb397fd..f9c2290 100644 --- a/freecad/Curves/PointInterpolation.py +++ b/freecad/Curves/PointInterpolation.py @@ -25,8 +25,8 @@ def __init__(self, points, periodic=False): self.Periodic = periodic self.check_duplicates() if self.Periodic and (not self.Duplicates) and self.are_closed(): - FreeCAD.Console.PrintMessage("Periodic interpolation\n") - FreeCAD.Console.PrintMessage("Ignoring duplicate last point\n") + FreeCAD.Console.PrintMessage(translate("Log", "Periodic interpolation\n")) + FreeCAD.Console.PrintMessage(translate("Log", "Ignoring duplicate last point\n")) self.Points = points[:-1] def are_closed(self): @@ -41,7 +41,7 @@ def check_duplicates(self): if self.Points[i].distanceToPoint(self.Points[i - 1]) > self.Tolerance: self.Duplicates = False break - FreeCAD.Console.PrintMessage("Duplicates point list\n") + FreeCAD.Console.PrintMessage(translate("Log", "Duplicates point list\n")) return self.Duplicates def parameters_along_curve(self, curve): @@ -54,8 +54,8 @@ def parameters_along_curve(self, curve): if par > params[-1]: params.append(par) else: - FreeCAD.Console.PrintError("Parameters are not increasing\n") - FreeCAD.Console.PrintError("Falling back to ChordLength\n") + FreeCAD.Console.PrintError(translate("Log", "Parameters are not increasing\n")) + FreeCAD.Console.PrintError(translate("Log", "Falling back to ChordLength\n")) params = self.get_parameters("ChordLength") break return params diff --git a/freecad/Curves/ProfileSketch.py b/freecad/Curves/ProfileSketch.py index 9f9656d..2e08a69 100644 --- a/freecad/Curves/ProfileSketch.py +++ b/freecad/Curves/ProfileSketch.py @@ -1,12 +1,15 @@ # -*- coding: utf-8 -*- -__title__ = 'Profile support plane' +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" __doc__ = 'Creates a support plane for sketches' import os -import FreeCAD import FreeCADGui import Part from . import ICONPATH @@ -24,12 +27,37 @@ def debug(string): class profileSupportFP: "creates a profile sketch" def __init__(self, obj): - ''' Add the properties ''' - obj.addProperty("App::PropertyLinkSub", "Edge1", "Profile", "First support edge") - obj.addProperty("App::PropertyLinkSub", "Edge2", "Profile", "Second support edge") - obj.addProperty("App::PropertyFloat", "Parameter1", "Profile", "Parameter on first edge") - obj.addProperty("App::PropertyFloat", "Parameter2", "Profile", "Parameter on second edge") - obj.addProperty("App::PropertyVector", "MainAxis", "Profile", "Main axis of the sketch") + """Add the properties""" + obj.addProperty( + "App::PropertyLinkSub", + "Edge1", + "Profile", + QT_TRANSLATE_NOOP("App::Property", "First support edge"), + ) + obj.addProperty( + "App::PropertyLinkSub", + "Edge2", + "Profile", + QT_TRANSLATE_NOOP("App::Property", "Second support edge"), + ) + obj.addProperty( + "App::PropertyFloat", + "Parameter1", + "Profile", + QT_TRANSLATE_NOOP("App::Property", "Parameter on first edge"), + ) + obj.addProperty( + "App::PropertyFloat", + "Parameter2", + "Profile", + QT_TRANSLATE_NOOP("App::Property", "Parameter on second edge"), + ) + obj.addProperty( + "App::PropertyVector", + "MainAxis", + "Profile", + QT_TRANSLATE_NOOP("App::Property", "Main axis of the sketch"), + ) obj.Proxy = self def getEdges(self, obj): @@ -127,7 +155,7 @@ def Activated(self): params = [] sel = FreeCADGui.Selection.getSelectionEx() if sel == []: - FreeCAD.Console.PrintError("Select 2 edges or vertexes first !\n") + FreeCAD.Console.PrintError(translate("Log", "Select 2 edges or vertexes first !\n")) for selobj in sel: if selobj.HasSubObjects: for i in range(len(selobj.SubObjects)): @@ -144,7 +172,7 @@ def Activated(self): # par = poe[2][0][2] params.append(0) else: - FreeCAD.Console.PrintError("Select 2 edges or vertexes first !\n") + FreeCAD.Console.PrintError(translate("Log", "Select 2 edges or vertexes first !\n")) if shapes: self.makeProfileFeature(shapes, params) diff --git a/freecad/Curves/ProfileSupportFP.py b/freecad/Curves/ProfileSupportFP.py index 7fd4017..c545463 100644 --- a/freecad/Curves/ProfileSupportFP.py +++ b/freecad/Curves/ProfileSupportFP.py @@ -71,26 +71,60 @@ class ProfileSupportFP: """Creates a ...""" def __init__(self, obj, rail1, rail2, prof=None): """Add the properties""" - obj.addProperty("App::PropertyLink", "Rail1", - "Sources", "Tooltip") - obj.addProperty("App::PropertyLink", "Rail2", - "Sources", "Tooltip") - obj.addProperty("App::PropertyLink", "ProfileShape", - "Sources", "Tooltip") - obj.addProperty("App::PropertyFloatConstraint", "Position1", - "Settings", "Tooltip") - obj.addProperty("App::PropertyFloatConstraint", "Position2", - "Settings", "Tooltip") - obj.addProperty("App::PropertyFloatConstraint", "NormalPosition", - "Settings", "Tooltip") - obj.addProperty("App::PropertyBool", "NormalReverse", - "Settings", "Tooltip") - obj.addProperty("App::PropertyDistance", "ChordLength", - "Info", "Tooltip") - obj.addProperty("App::PropertyDistance", "Rail1Length", - "Info", "Tooltip") - obj.addProperty("App::PropertyDistance", "Rail2Length", - "Info", "Tooltip") + obj.addProperty( + "App::PropertyLink", "Rail1", "Sources", QT_TRANSLATE_NOOP("App::Property", "Tooltip") + ) + obj.addProperty( + "App::PropertyLink", "Rail2", "Sources", QT_TRANSLATE_NOOP("App::Property", "Tooltip") + ) + obj.addProperty( + "App::PropertyLink", + "ProfileShape", + "Sources", + QT_TRANSLATE_NOOP("App::Property", "Tooltip"), + ) + obj.addProperty( + "App::PropertyFloatConstraint", + "Position1", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Tooltip"), + ) + obj.addProperty( + "App::PropertyFloatConstraint", + "Position2", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Tooltip"), + ) + obj.addProperty( + "App::PropertyFloatConstraint", + "NormalPosition", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Tooltip"), + ) + obj.addProperty( + "App::PropertyBool", + "NormalReverse", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Tooltip"), + ) + obj.addProperty( + "App::PropertyDistance", + "ChordLength", + "Info", + QT_TRANSLATE_NOOP("App::Property", "Tooltip"), + ) + obj.addProperty( + "App::PropertyDistance", + "Rail1Length", + "Info", + QT_TRANSLATE_NOOP("App::Property", "Tooltip"), + ) + obj.addProperty( + "App::PropertyDistance", + "Rail2Length", + "Info", + QT_TRANSLATE_NOOP("App::Property", "Tooltip"), + ) # obj.setPropertyStatus("ChordLength", "Output") # obj.setPropertyStatus("Rail1Length", "Output") # obj.setPropertyStatus("Rail2Length", "Output") @@ -209,7 +243,7 @@ def makeFeature(self, r1, r2, pr=None): def Activated(self): sel = FreeCADGui.Selection.getSelection() if len(sel) < 2: - FreeCAD.Console.PrintError("Select 2 rail objects, and optionally some profile objects\n") + FreeCAD.Console.PrintError(translate("Log", "Select 2 rail objects, and optionally some profile objects\n")) elif len(sel) == 2: self.makeFeature(sel[0], sel[1], None) else: diff --git a/freecad/Curves/ReflectLinesFP.py b/freecad/Curves/ReflectLinesFP.py index 746a60f..7391271 100644 --- a/freecad/Curves/ReflectLinesFP.py +++ b/freecad/Curves/ReflectLinesFP.py @@ -30,35 +30,35 @@ class ReflectLinesFP: def __init__(self, obj, src): """Add the properties""" obj.addProperty("App::PropertyLink", "Source", - "ReflectLines", "Source object") + "ReflectLines", QT_TRANSLATE_NOOP("App::Property", "Source object")) obj.addProperty("App::PropertyLinkSubList", "IndivFaces", - "ReflectLines", "Individual faces") + "ReflectLines", QT_TRANSLATE_NOOP("App::Property", "Individual faces")) obj.addProperty("App::PropertyVector", "ViewPos", - "ReflectLines", "View position") + "ReflectLines", QT_TRANSLATE_NOOP("App::Property", "View position")) obj.addProperty("App::PropertyVector", "ViewDir", - "ReflectLines", "View direction") + "ReflectLines", QT_TRANSLATE_NOOP("App::Property", "View direction")) obj.addProperty("App::PropertyVector", "UpDir", - "ReflectLines", "Up direction") + "ReflectLines", QT_TRANSLATE_NOOP("App::Property", "Up direction")) obj.addProperty("App::PropertyBool", "RemoveDuplicates", - "CleaningOptions", "Remove duplicate edges").RemoveDuplicates = False + "CleaningOptions", QT_TRANSLATE_NOOP("App::Property", "Remove duplicate edges")).RemoveDuplicates = False obj.addProperty("App::PropertyInteger", "Samples", - "CleaningOptions", "Number of edge samples").Samples = 10 + "CleaningOptions", QT_TRANSLATE_NOOP("App::Property", "Number of edge samples")).Samples = 10 obj.addProperty("App::PropertyQuantity", "CleaningTolerance", - "CleaningOptions", "CleaningTolerance for duplicate detection").CleaningTolerance = 1e-3 + "CleaningOptions", QT_TRANSLATE_NOOP("App::Property", "CleaningTolerance for duplicate detection")).CleaningTolerance = 1e-3 obj.addProperty("App::PropertyBool", "IsoLine", - "EdgeType", "Isoparametric lines").IsoLine = True + "EdgeType", QT_TRANSLATE_NOOP("App::Property", "Isoparametric lines")).IsoLine = True obj.addProperty("App::PropertyBool", "OutLine", - "EdgeType", "Outline silhouette lines").OutLine = True + "EdgeType", QT_TRANSLATE_NOOP("App::Property", "Outline silhouette lines")).OutLine = True obj.addProperty("App::PropertyBool", "Rg1Line", - "EdgeType", "smooth edge of G1-continuity between two surfaces").Rg1Line = True + "EdgeType", QT_TRANSLATE_NOOP("App::Property", "smooth edge of G1-continuity between two surfaces")).Rg1Line = True obj.addProperty("App::PropertyBool", "RgNLine", - "EdgeType", "sewn edge of CN-continuity on one surface").RgNLine = True + "EdgeType", QT_TRANSLATE_NOOP("App::Property", "sewn edge of CN-continuity on one surface")).RgNLine = True obj.addProperty("App::PropertyBool", "Sharp", - "EdgeType", "sharp edge (of C0-continuity)").Sharp = True + "EdgeType", QT_TRANSLATE_NOOP("App::Property", "sharp edge (of C0-continuity)")).Sharp = True obj.addProperty("App::PropertyBool", "Visible", - "ReflectLines", "Generate the visible lines, or the hidden lines").Visible = True + "ReflectLines", QT_TRANSLATE_NOOP("App::Property", "Generate the visible lines, or the hidden lines")).Visible = True obj.addProperty("App::PropertyBool", "OnShape", - "ReflectLines", "Output on-shape 3D lines").OnShape = True + "ReflectLines", QT_TRANSLATE_NOOP("App::Property", "Output on-shape 3D lines")).OnShape = True # obj.Samples = [10,3,999,1] obj.ViewPos = FreeCAD.Vector(0, 0, 0) obj.ViewDir = FreeCAD.Vector(0, 0, 1) @@ -121,7 +121,7 @@ def onChanged(self, obj, prop): class ReflectLinesVP: def __init__(self, vobj): vobj.addProperty("App::PropertyBool", "TrackCamera", - "AutoView", "Track camera movements").TrackCamera = False + "AutoView", QT_TRANSLATE_NOOP("App::Property", "Track camera movements")).TrackCamera = False vobj.Proxy = self def onChanged(self, vobj, prop): @@ -171,7 +171,7 @@ def makeFeature(self, s): def Activated(self): sel = FreeCADGui.Selection.getSelectionEx() if sel == []: - FreeCAD.Console.PrintError("Select an object first !\n") + FreeCAD.Console.PrintError(translate("Log", "Select an object first !\n")) else: rot = FreeCADGui.ActiveDocument.ActiveView.getCameraOrientation() vdir = FreeCAD.Vector(0, 0, 1) diff --git a/freecad/Curves/RotationSweepFP.py b/freecad/Curves/RotationSweepFP.py index 710ca47..aa6ded8 100644 --- a/freecad/Curves/RotationSweepFP.py +++ b/freecad/Curves/RotationSweepFP.py @@ -29,19 +29,19 @@ class RotsweepProxyFP: def __init__(self, obj): """Add the properties""" obj.addProperty("App::PropertyLinkSubList", "Profiles", - "InputShapes", "The list of profiles to sweep") + "InputShapes", QT_TRANSLATE_NOOP("App::Property", "The list of profiles to sweep")) obj.addProperty("App::PropertyLinkSub", "Path", - "InputShapes", "The sweep path") + "InputShapes", QT_TRANSLATE_NOOP("App::Property", "The sweep path")) obj.addProperty("App::PropertyLinkSub", "FaceSupport", - "ExtraProfiles", "Face support of the sweep path") + "ExtraProfiles", QT_TRANSLATE_NOOP("App::Property", "Face support of the sweep path")) obj.addProperty("App::PropertyBool", "TrimPath", - "Settings", "Trim the sweep shape").TrimPath = True + "Settings", QT_TRANSLATE_NOOP("App::Property", "Trim the sweep shape")).TrimPath = True obj.addProperty("App::PropertyBool", "ViewProfiles", - "Settings", "Add profiles to the sweep shape") + "Settings", QT_TRANSLATE_NOOP("App::Property", "Add profiles to the sweep shape")) obj.addProperty("App::PropertyInteger", "ExtraProfiles", - "ExtraProfiles", "Number of extra profiles") + "ExtraProfiles", QT_TRANSLATE_NOOP("App::Property", "Number of extra profiles")) obj.addProperty("App::PropertyBool", "SmoothTop", - "Settings", "Build a smooth top with extra profiles") + "Settings", QT_TRANSLATE_NOOP("App::Property", "Build a smooth top with extra profiles")) obj.setEditorMode("ViewProfiles", 2) # obj.setEditorMode("ExtraProfiles", 2) obj.Proxy = self diff --git a/freecad/Curves/Sketch_On_Surface.py b/freecad/Curves/Sketch_On_Surface.py index 4c5bc62..dcb1792 100644 --- a/freecad/Curves/Sketch_On_Surface.py +++ b/freecad/Curves/Sketch_On_Surface.py @@ -162,27 +162,66 @@ def print_tolerance(shape): class sketchOnSurface: "This feature object maps a sketch on a surface" def __init__(self, obj): - obj.addProperty("App::PropertyLink", "Sketch", "SketchOnSurface", - "Input Sketch") - obj.addProperty("App::PropertyLinkList", "ExtraObjects", - "SketchOnSurface", - "Additional objects that will be mapped on surface") - obj.addProperty("App::PropertyBool", "FillFaces", "Settings", - "Make faces from closed wires").FillFaces = False - obj.addProperty("App::PropertyBool", "FillExtrusion", "Settings", - "Add extrusion faces").FillExtrusion = True - obj.addProperty("App::PropertyFloat", "Offset", "Settings", - "Offset distance of mapped sketch").Offset = 0.0 - obj.addProperty("App::PropertyFloat", "Thickness", "Settings", - "Extrusion thickness").Thickness = 0.0 - obj.addProperty("App::PropertyBool", "ReverseU", "Touchup", - "Reverse U direction").ReverseU = False - obj.addProperty("App::PropertyBool", "ReverseV", "Touchup", - "Reverse V direction").ReverseV = False - obj.addProperty("App::PropertyBool", "SwapUV", "Touchup", - "Swap U and V directions").ReverseV = False - obj.addProperty("App::PropertyBool", "ConstructionBounds", "Touchup", - "include construction geometry in sketch bounds").ConstructionBounds = True + obj.addProperty( + "App::PropertyLink", + "Sketch", + "SketchOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Input Sketch"), + ) + obj.addProperty( + "App::PropertyLinkList", + "ExtraObjects", + "SketchOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Additional objects that will be mapped on surface"), + ) + obj.addProperty( + "App::PropertyBool", + "FillFaces", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Make faces from closed wires"), + ).FillFaces = False + obj.addProperty( + "App::PropertyBool", + "FillExtrusion", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Add extrusion faces"), + ).FillExtrusion = True + obj.addProperty( + "App::PropertyFloat", + "Offset", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Offset distance of mapped sketch"), + ).Offset = 0.0 + obj.addProperty( + "App::PropertyFloat", + "Thickness", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Extrusion thickness"), + ).Thickness = 0.0 + obj.addProperty( + "App::PropertyBool", + "ReverseU", + "Touchup", + QT_TRANSLATE_NOOP("App::Property", "Reverse U direction"), + ).ReverseU = False + obj.addProperty( + "App::PropertyBool", + "ReverseV", + "Touchup", + QT_TRANSLATE_NOOP("App::Property", "Reverse V direction"), + ).ReverseV = False + obj.addProperty( + "App::PropertyBool", + "SwapUV", + "Touchup", + QT_TRANSLATE_NOOP("App::Property", "Swap U and V directions"), + ).ReverseV = False + obj.addProperty( + "App::PropertyBool", + "ConstructionBounds", + "Touchup", + QT_TRANSLATE_NOOP("App::Property", "include construction geometry in sketch bounds"), + ).ConstructionBounds = True obj.Proxy = self def force_closed_bspline2d(self, c2d): @@ -379,7 +418,7 @@ def execute(self, obj): # faces.extend(loft.Faces) # except Part.OCCError: # # error_wires.extend([shapes_1[i].Wires[j], shapes_2[i].Wires[j]]) - # FreeCAD.Console.PrintError("Sketch on surface : failed to create loft face ({},{})".format(i,j)) + # FreeCAD.Console.PrintError(translate("Log", "Sketch on surface : failed to create loft face ({},{})")).format(i,j) try: shell = Part.Shell(faces) shell.sewShape() @@ -388,7 +427,7 @@ def execute(self, obj): solid.fixTolerance(1e-5) shapes.append(solid) except Exception: - FreeCAD.Console.PrintWarning("Sketch on surface : failed to create solid # {}.\n".format(i + 1)) + FreeCAD.Console.PrintWarning(translate("Log", "Sketch on surface : failed to create solid # {}.\n")).format(i + 1) shapes.extend(faces) else: ruled = ruled_surface(shapes_1[i].Wires[0], shapes_2[i].Wires[0]) @@ -514,7 +553,7 @@ def Activated(self): doc = FreeCAD.ActiveDocument sketch, face_link = self.get_selection() if not sketch and not face_link: - FreeCAD.Console.PrintMessage("Please select a face (in the 3D view) or a sketch\n") + FreeCAD.Console.PrintMessage(translate("Log", "Please select a face (in the 3D view) or a sketch\n")) return if not sketch: sketch = doc.addObject('Sketcher::SketchObject', 'Mapped_Sketch') diff --git a/freecad/Curves/SurfaceAnalysisFP.py b/freecad/Curves/SurfaceAnalysisFP.py index 6f51f83..2b1dfe8 100644 --- a/freecad/Curves/SurfaceAnalysisFP.py +++ b/freecad/Curves/SurfaceAnalysisFP.py @@ -73,8 +73,12 @@ class SurfaceAnalysisProxyFP: """Creates a ...""" def __init__(self, obj): """Add the properties""" - obj.addProperty("App::PropertyLinkList", "Sources", - "Group", "Tooltip") + obj.addProperty( + "App::PropertyLinkList", + "Sources", + "Group", + QT_TRANSLATE_NOOP("App::Property", "Tooltip"), + ) obj.Proxy = self def execute(self, obj): @@ -86,30 +90,80 @@ def onChanged(self, obj, prop): class SurfaceAnalysisProxyVP: def __init__(self, viewobj): - viewobj.addProperty("App::PropertyVector", "Direction", - "AnalysisMode", "Analysis Direction") - viewobj.addProperty("App::PropertyEnumeration", "Mode", - "AnalysisMode", "Analysis Mode") - viewobj.addProperty("App::PropertyBool", "Fixed", - "AnalysisMode", "Fix analysis direction to global coordinate system") - viewobj.addProperty("App::PropertyInteger", "StripesNumber", - "AnalysisOptions", "Number of stripes (Zebra, Rainbow)") - viewobj.addProperty("App::PropertyFloatConstraint", "StripesRatio", - "AnalysisOptions", "Relative width of stripes (Zebra)") - viewobj.addProperty("App::PropertyColor", "Color1", - "AnalysisOptions", "First color (Zebra, Rainbow, Isophote)") - viewobj.addProperty("App::PropertyColor", "Color2", - "AnalysisOptions", "Second color (Zebra, Rainbow, Isophote)") - viewobj.addProperty("App::PropertyFloatConstraint", "RainbowAngle1", - "AnalysisOptions", "Start angle of the rainbow") - viewobj.addProperty("App::PropertyFloatConstraint", "RainbowAngle2", - "AnalysisOptions", "End angle of the rainbow") - viewobj.addProperty("App::PropertyFloatList", "IsoAngles", - "AnalysisOptions", "Angles of isophote curves") - viewobj.addProperty("App::PropertyFloat", "IsoTolerance", - "AnalysisOptions", "Angular tolerance of isophote curves") - viewobj.addProperty("App::PropertyFloatConstraint", "Shading", - "AnalysisMode", "Amount of shading on the analysis overlay") + viewobj.addProperty( + "App::PropertyVector", + "Direction", + "AnalysisMode", + QT_TRANSLATE_NOOP("App::Property", "Analysis Direction"), + ) + viewobj.addProperty( + "App::PropertyEnumeration", + "Mode", + "AnalysisMode", + QT_TRANSLATE_NOOP("App::Property", "Analysis Mode"), + ) + viewobj.addProperty( + "App::PropertyBool", + "Fixed", + "AnalysisMode", + QT_TRANSLATE_NOOP( + "App::Property", "Fix analysis direction to global coordinate system" + ), + ) + viewobj.addProperty( + "App::PropertyInteger", + "StripesNumber", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Number of stripes (Zebra, Rainbow)"), + ) + viewobj.addProperty( + "App::PropertyFloatConstraint", + "StripesRatio", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Relative width of stripes (Zebra)"), + ) + viewobj.addProperty( + "App::PropertyColor", + "Color1", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "First color (Zebra, Rainbow, Isophote)"), + ) + viewobj.addProperty( + "App::PropertyColor", + "Color2", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Second color (Zebra, Rainbow, Isophote)"), + ) + viewobj.addProperty( + "App::PropertyFloatConstraint", + "RainbowAngle1", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Start angle of the rainbow"), + ) + viewobj.addProperty( + "App::PropertyFloatConstraint", + "RainbowAngle2", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "End angle of the rainbow"), + ) + viewobj.addProperty( + "App::PropertyFloatList", + "IsoAngles", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Angles of isophote curves"), + ) + viewobj.addProperty( + "App::PropertyFloat", + "IsoTolerance", + "AnalysisOptions", + QT_TRANSLATE_NOOP("App::Property", "Angular tolerance of isophote curves"), + ) + viewobj.addProperty( + "App::PropertyFloatConstraint", + "Shading", + "AnalysisMode", + QT_TRANSLATE_NOOP("App::Property", "Amount of shading on the analysis overlay"), + ) viewobj.Direction = (1, 0, 0) viewobj.Mode = ["Zebra", "Rainbow", "Isophote"] viewobj.Mode = "Zebra" @@ -240,7 +294,7 @@ def setPreselection(self, doc, obj, sub): pass def clearSelection(self, doc): # If screen is clicked, delete selection - # FreeCAD.Console.PrintMessage("clearSelection\n") + # FreeCAD.Console.PrintMessage(translate("Log", "clearSelection\n")) pass # self.Object.ViewObject.DraftAngles = [] class SurfaceAnalysisCommand: diff --git a/freecad/Curves/Sweep2Rails.py b/freecad/Curves/Sweep2Rails.py index df469d5..9f7c5fa 100644 --- a/freecad/Curves/Sweep2Rails.py +++ b/freecad/Curves/Sweep2Rails.py @@ -1,6 +1,7 @@ import os import FreeCAD import FreeCADGui + # import Part # from FreeCAD import Base from pivy import coin @@ -12,6 +13,9 @@ fac = 1.0 DEBUG = False +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + def debug(string): if DEBUG: @@ -22,15 +26,57 @@ def debug(string): class sweep2rails: def __init__(self, obj): obj.Proxy = self - obj.addProperty("App::PropertyLink", "Birail", "Base", "Birail object") - obj.addProperty("App::PropertyLinkList", "Profiles", "Base", "List of profiles") - obj.addProperty("App::PropertyEnumeration","Blending", "Base", "Blending method").Blending = ["Average","Blend","Rail1","Rail2"] - obj.addProperty("App::PropertyFloat", "Parametrization","Base", "Parametrization of interpolating curves") - obj.addProperty("App::PropertyInteger", "ProfileSamples", "Base", "Profile Samples") - obj.addProperty("App::PropertyInteger", "RailSamples", "Base", "Profile Samples") - obj.addProperty("App::PropertyBool", "Extend", "Base", "Extend to rail limits") - obj.addProperty("App::PropertyVectorList", "Points", "Base", "Points") - obj.addProperty("Part::PropertyPartShape", "Shape", "Base", "Shape") + obj.addProperty( + "App::PropertyLink", + "Birail", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Birail object"), + ) + obj.addProperty( + "App::PropertyLinkList", + "Profiles", + "Base", + QT_TRANSLATE_NOOP("App::Property", "List of profiles"), + ) + obj.addProperty( + "App::PropertyEnumeration", + "Blending", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Blending method"), + ).Blending = ["Average", "Blend", "Rail1", "Rail2"] + obj.addProperty( + "App::PropertyFloat", + "Parametrization", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Parametrization of interpolating curves"), + ) + obj.addProperty( + "App::PropertyInteger", + "ProfileSamples", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Profile Samples"), + ) + obj.addProperty( + "App::PropertyInteger", + "RailSamples", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Profile Samples"), + ) + obj.addProperty( + "App::PropertyBool", + "Extend", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Extend to rail limits"), + ) + obj.addProperty( + "App::PropertyVectorList", + "Points", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Points"), + ) + obj.addProperty( + "Part::PropertyPartShape", "Shape", "Base", QT_TRANSLATE_NOOP("App::Property", "Shape") + ) obj.Blending = "Blend" obj.ProfileSamples = 20 obj.RailSamples = 20 @@ -126,7 +172,7 @@ def attach(self, vobj): # vobj.DisplayMode = "Wireframe" def updateData(self, fp, prop): - FreeCAD.Console.PrintMessage("updateDate : " + str(prop) + "\n") + FreeCAD.Console.PrintMessage(translate("Log", "updateDate : " + str(prop) + "\n")) if len(fp.Points) == fp.RailSamples * fp.ProfileSamples: self.coord.points = fp.Points self.row.vertices = (fp.RailSamples, fp.ProfileSamples) @@ -134,7 +180,7 @@ def updateData(self, fp, prop): def onChanged(self, vp, prop): "Here we can do something when a single property got changed" - FreeCAD.Console.PrintMessage("Change property: " + str(prop) + "\n") + FreeCAD.Console.PrintMessage(translate("Log", "Change property: " + str(prop) + "\n")) def getDisplayModes(self, obj): "Return a list of display modes." @@ -184,7 +230,7 @@ def onDelete(self, feature, subelements): for p in self.Object.Profiles: p.ViewObject.show() except Exception as err: - FreeCAD.Console.PrintError("Error in onDelete: {0} \n".format(err)) + FreeCAD.Console.PrintError(translate("Log", "Error in onDelete: {0} \n")).format(err) return True @@ -202,7 +248,7 @@ def parseSel(self, selectionObject): def Activated(self): s = FreeCADGui.Selection.getSelection() if s == []: - FreeCAD.Console.PrintError("Select a ruled surface and a list of profile edges\n") + FreeCAD.Console.PrintError(translate("Log", "Select a ruled surface and a list of profile edges\n")) return myS2R = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "Sweep 2 rails") diff --git a/freecad/Curves/Sweep2RailsFP.py b/freecad/Curves/Sweep2RailsFP.py index d27565f..e38f298 100644 --- a/freecad/Curves/Sweep2RailsFP.py +++ b/freecad/Curves/Sweep2RailsFP.py @@ -73,9 +73,9 @@ class Sweep2RailsObjProxy: def __init__(self, obj, sel): """Add the properties""" obj.addProperty("App::PropertyLinkList", "Rails", - "Sources", "Tooltip") + "Sources", QT_TRANSLATE_NOOP("App::Property", "Tooltip")) obj.addProperty("App::PropertyLinkList", "Profiles", - "Sources", "Tooltip") + "Sources", QT_TRANSLATE_NOOP("App::Property", "Tooltip")) obj.Rails = sel[:2] obj.Profiles = sel[2:] obj.Proxy = self @@ -148,7 +148,7 @@ def makeFeature(self, sel=None): def Activated(self): sel = FreeCADGui.Selection.getSelection() if len(sel) < 1: - FreeCAD.Console.PrintError("Select 2 rails and at least 2 profiles\n") + FreeCAD.Console.PrintError(translate("Log", "Select 2 rails and at least 2 profiles\n")) else: self.makeFeature(sel) diff --git a/freecad/Curves/TemplateFP.py b/freecad/Curves/TemplateFP.py index 05a3675..a880c98 100644 --- a/freecad/Curves/TemplateFP.py +++ b/freecad/Curves/TemplateFP.py @@ -28,8 +28,8 @@ class TemplateFP: """Creates a ...""" def __init__(self, obj): """Add the properties""" - obj.addProperty("App::PropertyLinkList", "Sources", "Group", "Tooltip") - obj.addProperty("App::PropertyFloat", "float", "Group", "Tooltip") + obj.addProperty("App::PropertyLinkList", "Sources", "Group", QT_TRANSLATE_NOOP("App::Property", "Tooltip")) + obj.addProperty("App::PropertyFloat", "float", "Group", QT_TRANSLATE_NOOP("App::Property", "Tooltip")) obj.Proxy = self def execute(self, obj): @@ -77,7 +77,7 @@ def makeFeature(self, sel=None): def Activated(self): sel = FreeCADGui.Selection.getSelection() if sel == []: - FreeCAD.Console.PrintError("Select something first !\n") + FreeCAD.Console.PrintError(translate("Log", "Select something first !\n")) else: self.makeFeature(sel) diff --git a/freecad/Curves/TrimFace.py b/freecad/Curves/TrimFace.py index bd0be06..55234f8 100644 --- a/freecad/Curves/TrimFace.py +++ b/freecad/Curves/TrimFace.py @@ -16,7 +16,9 @@ import BOPTools.SplitAPI splitAPI = BOPTools.SplitAPI except ImportError: - FreeCAD.Console.PrintError("Failed importing BOPTools. Fallback to Part API\n") + FreeCAD.Console.PrintError( + translate("Log", "Failed importing BOPTools. Fallback to Part API\n") + ) splitAPI = Part.BOPTools.SplitAPI TOOL_ICON = os.path.join(ICONPATH, 'trimFace.svg') @@ -26,23 +28,45 @@ def debug(string): if DEBUG: FreeCAD.Console.PrintMessage(string) - FreeCAD.Console.PrintMessage("\n") + FreeCAD.Console.PrintMessage(translate("Log", "\n")) class trimFace: def __init__(self, obj): ''' Add the properties ''' debug("\ntrimFace init") - obj.addProperty("App::PropertyLinkSub", "Face", - "TrimFace", "Input face") - obj.addProperty("App::PropertyVector", "PickedPoint", - "TrimFace", "Picked point in parametric space of the face (u,v,0)") - obj.addProperty("App::PropertyLinkSubList", "Tool", - "TrimFace", "Trimming curve") - obj.addProperty("App::PropertyLink", "DirVector", - "TrimFace", "Trimming Vector") - obj.addProperty("App::PropertyVector", "Direction", - "TrimFace", "Trimming direction") + obj.addProperty( + "App::PropertyLinkSub", + "Face", + "TrimFace", + QT_TRANSLATE_NOOP("App::Property", "Input face"), + ) + obj.addProperty( + "App::PropertyVector", + "PickedPoint", + "TrimFace", + QT_TRANSLATE_NOOP( + "App::Property", "Picked point in parametric space of the face (u,v,0)" + ), + ) + obj.addProperty( + "App::PropertyLinkSubList", + "Tool", + "TrimFace", + QT_TRANSLATE_NOOP("App::Property", "Trimming curve"), + ) + obj.addProperty( + "App::PropertyLink", + "DirVector", + "TrimFace", + QT_TRANSLATE_NOOP("App::Property", "Trimming Vector"), + ) + obj.addProperty( + "App::PropertyVector", + "Direction", + "TrimFace", + QT_TRANSLATE_NOOP("App::Property", "Trimming direction"), + ) obj.Proxy = self def getFace(self, link): diff --git a/freecad/Curves/Truncate_Extend_FP.py b/freecad/Curves/Truncate_Extend_FP.py index 27e40d8..a861d60 100644 --- a/freecad/Curves/Truncate_Extend_FP.py +++ b/freecad/Curves/Truncate_Extend_FP.py @@ -23,16 +23,38 @@ class TruncateExtendFP: def __init__(self, obj): """Add the properties""" - obj.addProperty("App::PropertyLink", "Source", - "InputObjects", "The object that will be truncated or extended") - obj.addProperty("App::PropertyLink", "Cutter", - "InputObjects", "The planar object that cuts the Source object") - obj.addProperty("App::PropertyDistance", "Distance", - "Settings", "The distance to truncate (if negative) or extend (if positive)") - obj.addProperty("App::PropertyBool", "Refine", - "Settings", "Refine shape (clean up redundant edges)") - obj.addProperty("App::PropertyBool", "Reverse", - "Settings", "Reverse cutter plane normal") + obj.addProperty( + "App::PropertyLink", + "Source", + "InputObjects", + QT_TRANSLATE_NOOP("App::Property", "The object that will be truncated or extended"), + ) + obj.addProperty( + "App::PropertyLink", + "Cutter", + "InputObjects", + QT_TRANSLATE_NOOP("App::Property", "The planar object that cuts the Source object"), + ) + obj.addProperty( + "App::PropertyDistance", + "Distance", + "Settings", + QT_TRANSLATE_NOOP( + "App::Property", "The distance to truncate (if negative) or extend (if positive)" + ), + ) + obj.addProperty( + "App::PropertyBool", + "Refine", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Refine shape (clean up redundant edges)"), + ) + obj.addProperty( + "App::PropertyBool", + "Reverse", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Reverse cutter plane normal"), + ) obj.Distance = 10.0 obj.Proxy = self @@ -128,7 +150,7 @@ def Activated(self): elif len(sel) == 2: self.makePartFeature(sel) else: - FreeCAD.Console.PrintError("Wrong Selection\n") + FreeCAD.Console.PrintError(translate("Log", "Wrong Selection\n")) def IsActive(self): if FreeCADGui.Selection.getSelection(): diff --git a/freecad/Curves/ZebraTool.py b/freecad/Curves/ZebraTool.py index 0b46de1..fa013e0 100644 --- a/freecad/Curves/ZebraTool.py +++ b/freecad/Curves/ZebraTool.py @@ -140,7 +140,7 @@ def Activated(self): ZebraTool.active = True show_task_panel(ZebraForm(self.gui)) else: - FreeCAD.Console.PrintMessage("Zebra already active\n") + FreeCAD.Console.PrintMessage(translate("Log", "Zebra already active\n")) def GetResources(self): return {'Pixmap': TOOL_ICON, diff --git a/freecad/Curves/__init__.py b/freecad/Curves/__init__.py index 3df875b..f73512b 100644 --- a/freecad/Curves/__init__.py +++ b/freecad/Curves/__init__.py @@ -3,6 +3,7 @@ from .version import __version__ ICONPATH = os.path.join(os.path.dirname(__file__), "resources", "icons") +TRANSLATIONPATH = os.path.join(os.path.dirname(__file__), "resources", "translations") TOL3D = 1e-7 TOL2D = 1e-9 diff --git a/freecad/Curves/_utils.py b/freecad/Curves/_utils.py index 0bcc59b..55816c2 100644 --- a/freecad/Curves/_utils.py +++ b/freecad/Curves/_utils.py @@ -89,7 +89,7 @@ def getShape(obj, prop, shape_type): res.append(getSubShape(sh, shape_type, n)) return res else: - FreeCAD.Console.PrintError("CurvesWB._utils.getShape: wrong property type.\n") + FreeCAD.Console.PrintError(translate("Log", "CurvesWB._utils.getShape: wrong property type.\n")) return None else: # FreeCAD.Console.PrintError("CurvesWB._utils.getShape: %r has no property %r\n"%(obj, prop)) diff --git a/freecad/Curves/adjacent_faces.py b/freecad/Curves/adjacent_faces.py index 58af292..ffa1c0b 100644 --- a/freecad/Curves/adjacent_faces.py +++ b/freecad/Curves/adjacent_faces.py @@ -64,7 +64,7 @@ def Activated(self): for a in anc: sel.addSelection(obj, self.get_subname(shape, a)) if len(result) == 0: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) def IsActive(self): if FreeCAD.ActiveDocument: diff --git a/freecad/Curves/approximate.py b/freecad/Curves/approximate.py index 870d999..f0f8cec 100644 --- a/freecad/Curves/approximate.py +++ b/freecad/Curves/approximate.py @@ -12,14 +12,16 @@ # from freecad.Curves import _utils from freecad.Curves import ICONPATH -TOOL_ICON = os.path.join(ICONPATH, 'approximate.svg') +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +TOOL_ICON = os.path.join(ICONPATH, "approximate.svg") DEBUG = False def debug(string): if DEBUG: FreeCAD.Console.PrintMessage(string) - FreeCAD.Console.PrintMessage("\n") + FreeCAD.Console.PrintMessage(translate("Log", "\n")) # ******************************************************** # **** Part.BSplineCurve.approximate() documentation ***** @@ -59,38 +61,101 @@ class Approximate: def __init__(self, obj, source): ''' Add the properties ''' debug("\nApproximate class Init\n") - obj.addProperty("App::PropertyLink", "PointObject", "Approximate", - "Object containing the points to approximate").PointObject = source - obj.addProperty("App::PropertyBool", "ClampEnds", "General", - "Clamp endpoints").ClampEnds = False - obj.addProperty("App::PropertyBool", "Closed", "General", - "Force a closed curve").Closed = False - obj.addProperty("App::PropertyInteger", "DegreeMin", "General", - "Minimum degree of the curve").DegreeMin = 3 - obj.addProperty("App::PropertyInteger", "DegreeMax", "General", - "Maximum degree of the curve").DegreeMax = 5 - obj.addProperty("App::PropertyFloat", "ApproxTolerance", "General", - "Approximation tolerance") - obj.addProperty("App::PropertyEnumeration", "Continuity", "General", - "Desired continuity of the curve").Continuity = ["C0", "C1", "G1", "C2", "G2", "C3", "CN"] - obj.addProperty("App::PropertyEnumeration", "Method", "General", - "Approximation method").Method = ["Parametrization", "Smoothing Algorithm"] - obj.addProperty("App::PropertyEnumeration", "Parametrization", "Parameters", - "Parametrization type").Parametrization = ["ChordLength", "Centripetal", "Uniform", "Curvilinear"] - obj.addProperty("App::PropertyFloatConstraint", "LengthWeight", "Parameters", - "Weight of curve length for smoothing algorithm").LengthWeight = 1.0 - obj.addProperty("App::PropertyFloatConstraint", "CurvatureWeight", "Parameters", - "Weight of curve curvature for smoothing algorithm").CurvatureWeight = 1.0 - obj.addProperty("App::PropertyFloatConstraint", "TorsionWeight", "Parameters", - "Weight of curve torsion for smoothing algorithm").TorsionWeight = 1.0 - obj.addProperty("App::PropertyInteger", "FirstIndex", "Range", - "Index of first point").FirstIndex = 0 - obj.addProperty("App::PropertyInteger", "LastIndex", "Range", - "Index of last point (-1 to ignore)") - obj.addProperty("App::PropertyInteger", "StartOffset", "Range", - "For closed curves, allows to choose the location of the join point").StartOffset = 0 - # obj.addProperty("App::PropertyVectorList", "Points", "Approximate", "Points") - # obj.addProperty("Part::PropertyPartShape", "Shape", "Approximate", "Shape") + obj.addProperty( + "App::PropertyLink", + "PointObject", + "Approximate", + QT_TRANSLATE_NOOP("App::Property", "Object containing the points to approximate"), + ).PointObject = source + obj.addProperty( + "App::PropertyBool", + "ClampEnds", + "General", + QT_TRANSLATE_NOOP("App::Property", "Clamp endpoints"), + ).ClampEnds = False + obj.addProperty( + "App::PropertyBool", + "Closed", + "General", + QT_TRANSLATE_NOOP("App::Property", "Force a closed curve"), + ).Closed = False + obj.addProperty( + "App::PropertyInteger", + "DegreeMin", + "General", + QT_TRANSLATE_NOOP("App::Property", "Minimum degree of the curve"), + ).DegreeMin = 3 + obj.addProperty( + "App::PropertyInteger", + "DegreeMax", + "General", + QT_TRANSLATE_NOOP("App::Property", "Maximum degree of the curve"), + ).DegreeMax = 5 + obj.addProperty( + "App::PropertyFloat", + "ApproxTolerance", + "General", + QT_TRANSLATE_NOOP("App::Property", "Approximation tolerance"), + ) + obj.addProperty( + "App::PropertyEnumeration", + "Continuity", + "General", + QT_TRANSLATE_NOOP("App::Property", "Desired continuity of the curve"), + ).Continuity = ["C0", "C1", "G1", "C2", "G2", "C3", "CN"] + obj.addProperty( + "App::PropertyEnumeration", + "Method", + "General", + QT_TRANSLATE_NOOP("App::Property", "Approximation method"), + ).Method = ["Parametrization", "Smoothing Algorithm"] + obj.addProperty( + "App::PropertyEnumeration", + "Parametrization", + "Parameters", + QT_TRANSLATE_NOOP("App::Property", "Parametrization type"), + ).Parametrization = ["ChordLength", "Centripetal", "Uniform", "Curvilinear"] + obj.addProperty( + "App::PropertyFloatConstraint", + "LengthWeight", + "Parameters", + QT_TRANSLATE_NOOP("App::Property", "Weight of curve length for smoothing algorithm"), + ).LengthWeight = 1.0 + obj.addProperty( + "App::PropertyFloatConstraint", + "CurvatureWeight", + "Parameters", + QT_TRANSLATE_NOOP("App::Property", "Weight of curve curvature for smoothing algorithm"), + ).CurvatureWeight = 1.0 + obj.addProperty( + "App::PropertyFloatConstraint", + "TorsionWeight", + "Parameters", + QT_TRANSLATE_NOOP("App::Property", "Weight of curve torsion for smoothing algorithm"), + ).TorsionWeight = 1.0 + obj.addProperty( + "App::PropertyInteger", + "FirstIndex", + "Range", + QT_TRANSLATE_NOOP("App::Property", "Index of first point"), + ).FirstIndex = 0 + obj.addProperty( + "App::PropertyInteger", + "LastIndex", + "Range", + QT_TRANSLATE_NOOP("App::Property", "Index of last point (-1 to ignore)"), + ) + obj.addProperty( + "App::PropertyInteger", + "StartOffset", + "Range", + QT_TRANSLATE_NOOP( + "App::Property", + "For closed curves, allows to choose the location of the join point", + ), + ).StartOffset = 0 + # obj.addProperty("App::PropertyVectorList", "Points", "Approximate", QT_TRANSLATE_NOOP("App::Property", "Points")) + # obj.addProperty("Part::PropertyPartShape", "Shape", "Approximate", QT_TRANSLATE_NOOP("App::Property", "Shape")) obj.Proxy = self self.obj = obj self.Points = [] @@ -366,7 +431,7 @@ def onDelete(self, feature, subelements): try: self.Object.PointObject.ViewObject.Visibility = True except Exception as err: - FreeCAD.Console.PrintError("Error in onDelete: {0} \n".format(err)) + FreeCAD.Console.PrintError(translate("Log", "Error in onDelete: {0} \n")).format(err) return True @@ -383,7 +448,9 @@ def parseSel(self, selectionObject): if res: return res else: - FreeCAD.Console.PrintMessage("\nPlease select an object that has at least 2 vertexes") + FreeCAD.Console.PrintMessage( + translate("Log", "\nPlease select an object that has at least 2 vertexes") + ) return None def Activated(self): diff --git a/freecad/Curves/approximate_extension.py b/freecad/Curves/approximate_extension.py index f3d3efb..b0a460e 100644 --- a/freecad/Curves/approximate_extension.py +++ b/freecad/Curves/approximate_extension.py @@ -51,14 +51,14 @@ class ApproximateExtension: def __init__(self, obj): ''' Add the properties ''' debug("\nApproximate extension Init\n") - obj.addProperty("App::PropertyInteger", "Samples", "ShapeApproximation", "Number of samples").Samples = 100 - obj.addProperty("App::PropertyBool", "Active", "ShapeApproximation", "Use approximation") - obj.addProperty("App::PropertyInteger", "DegreeMin", "ShapeApproximation", "Minimum degree of the curve").DegreeMin = 3 - obj.addProperty("App::PropertyInteger", "DegreeMax", "ShapeApproximation", "Maximum degree of the curve").DegreeMax = 5 - obj.addProperty("App::PropertyFloat", "ApproxTolerance", "ShapeApproximation", "Approximation tolerance") - obj.addProperty("App::PropertyEnumeration", "Continuity", "ShapeApproximation", "Desired continuity of the curve").Continuity = ["C0", "C1", "G1", "C2", "G2", "C3", "CN"] - obj.addProperty("App::PropertyEnumeration", "Parametrization", "ShapeApproximation", "Parametrization type").Parametrization = ["ChordLength", "Centripetal", "Uniform"] - obj.addProperty("App::PropertyPythonObject", "ExtensionProxy", "ShapeApproximation", "Proxy object of the approximation extension").ExtensionProxy = self + obj.addProperty("App::PropertyInteger", "Samples", "ShapeApproximation", QT_TRANSLATE_NOOP("App::Property", "Number of samples")).Samples = 100 + obj.addProperty("App::PropertyBool", "Active", "ShapeApproximation", QT_TRANSLATE_NOOP("App::Property", "Use approximation")) + obj.addProperty("App::PropertyInteger", "DegreeMin", "ShapeApproximation", QT_TRANSLATE_NOOP("App::Property", "Minimum degree of the curve")).DegreeMin = 3 + obj.addProperty("App::PropertyInteger", "DegreeMax", "ShapeApproximation", QT_TRANSLATE_NOOP("App::Property", "Maximum degree of the curve")).DegreeMax = 5 + obj.addProperty("App::PropertyFloat", "ApproxTolerance", "ShapeApproximation", QT_TRANSLATE_NOOP("App::Property", "Approximation tolerance")) + obj.addProperty("App::PropertyEnumeration", "Continuity", "ShapeApproximation", QT_TRANSLATE_NOOP("App::Property", "Desired continuity of the curve")).Continuity = ["C0", "C1", "G1", "C2", "G2", "C3", "CN"] + obj.addProperty("App::PropertyEnumeration", "Parametrization", "ShapeApproximation", QT_TRANSLATE_NOOP("App::Property", "Parametrization type")).Parametrization = ["ChordLength", "Centripetal", "Uniform"] + obj.addProperty("App::PropertyPythonObject", "ExtensionProxy", "ShapeApproximation", QT_TRANSLATE_NOOP("App::Property", "Proxy object of the approximation extension")).ExtensionProxy = self obj.Parametrization = "ChordLength" obj.Continuity = 'C3' self.setTolerance(obj) diff --git a/freecad/Curves/blendSolidFP.py b/freecad/Curves/blendSolidFP.py index 55290d5..61f103f 100644 --- a/freecad/Curves/blendSolidFP.py +++ b/freecad/Curves/blendSolidFP.py @@ -22,31 +22,31 @@ class BlendSolidProxy: """Proxy of a BlendSolid FeaturePython object""" def __init__(self, obj): obj.addProperty("App::PropertyLinkSubList", "Sources", - "Base", "Faces to join") + "Base", QT_TRANSLATE_NOOP("App::Property", "Faces to join")) obj.addProperty("App::PropertyInteger", "Samples", - "Settings", "Number of samples to generate each surface") + "Settings", QT_TRANSLATE_NOOP("App::Property", "Number of samples to generate each surface")) obj.addProperty("App::PropertyBool", "Fuse", - "Settings", "Fuse the 3 solids together") + "Settings", QT_TRANSLATE_NOOP("App::Property", "Fuse the 3 solids together")) # obj.addProperty("App::PropertyEnumeration", "Algo", - # "Untwist", "Method used to untwist the wires") + # "Untwist", QT_TRANSLATE_NOOP("App::Property", "Method used to untwist the wires")) # obj.addProperty("App::PropertyLinkSubList", "MatchingShapes", - # "Untwist", "User selected matching edges or vertexes") + # "Untwist", QT_TRANSLATE_NOOP("App::Property", "User selected matching edges or vertexes")) # obj.addProperty("App::PropertyVectorList", "Offset", - # "Untwist", "Offset edge indices") + # "Untwist", QT_TRANSLATE_NOOP("App::Property", "Offset edge indices")) obj.addProperty("App::PropertyInteger", "Continuity1", - "Continuity", "Continuity order G... with shape 1") + "Continuity", QT_TRANSLATE_NOOP("App::Property", "Continuity order G... with shape 1")) obj.addProperty("App::PropertyInteger", "Continuity2", - "Continuity", "Continuity order G... with shape 2") + "Continuity", QT_TRANSLATE_NOOP("App::Property", "Continuity order G... with shape 2")) obj.addProperty("App::PropertyEnumeration", "AutoScale", - "Scale", "Compute scales to get regular poles, or minimal curvature") + "Scale", QT_TRANSLATE_NOOP("App::Property", "Compute scales to get regular poles, or minimal curvature")) obj.addProperty("App::PropertyInteger", "ScaleSamples", - "Scale", "Number of samples for auto scaling") + "Scale", QT_TRANSLATE_NOOP("App::Property", "Number of samples for auto scaling")) obj.addProperty("App::PropertyFloatList", "Scale1", - "Scale", "Scale values along face 1") + "Scale", QT_TRANSLATE_NOOP("App::Property", "Scale values along face 1")) obj.addProperty("App::PropertyFloatList", "Scale2", - "Scale", "Scale values along face 2") + "Scale", QT_TRANSLATE_NOOP("App::Property", "Scale values along face 2")) obj.addProperty("App::PropertyString", "ShapeType", - "Status", "Status of the created shape") + "Status", QT_TRANSLATE_NOOP("App::Property", "Status of the created shape")) obj.ShapeType = "" obj.setEditorMode("ShapeType", 1) obj.ScaleSamples = 6 @@ -227,14 +227,14 @@ def Activated(self): if "Face" in sen: sources.append((selobj.Object, sen)) if not len(sources) == 2: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) else: f1 = sources[0][0].getSubObject(sources[0][1]) f2 = sources[1][0].getSubObject(sources[1][1]) if len(f1.Edges) == len(f2.Edges): self.makeFeature(sources) else: - FreeCAD.Console.PrintError("BlendSolid : The two faces must have the same number of edges\n") + FreeCAD.Console.PrintError(translate("Log", "BlendSolid : The two faces must have the same number of edges\n")) def IsActive(self): if FreeCAD.ActiveDocument: diff --git a/freecad/Curves/blendSurface.py b/freecad/Curves/blendSurface.py index bea8e0f..dbc94b1 100644 --- a/freecad/Curves/blendSurface.py +++ b/freecad/Curves/blendSurface.py @@ -77,7 +77,7 @@ def compute_scale(self, sc, edge): elif isinstance(sc, (float, int)): return([float(sc)] * self.railSamples) else: - FreeCAD.Console.PrintError("BlendSurface : failed to compute scale\n{}\n".format(sc)) + FreeCAD.Console.PrintError(translate("Log", "BlendSurface : failed to compute scale\n{}\n")).format(sc) return(None) def cross_curves2(self): diff --git a/freecad/Curves/blendSurfaceFP.py b/freecad/Curves/blendSurfaceFP.py index 42c4bc6..98cdecd 100644 --- a/freecad/Curves/blendSurfaceFP.py +++ b/freecad/Curves/blendSurfaceFP.py @@ -15,7 +15,7 @@ def debug(string): if DEBUG: FreeCAD.Console.PrintMessage(string) - FreeCAD.Console.PrintMessage("\n") + FreeCAD.Console.PrintMessage(translate("Log", "\n")) def downgradeArray(arr): @@ -47,20 +47,20 @@ def getComboView(mw): class blendSurfFP: def __init__(self, obj): obj.Proxy = self - obj.addProperty("App::PropertyLink", "Edge1", "Base", "First edge") - obj.addProperty("App::PropertyLink", "Edge2", "Base", "Second edge") - #obj.addProperty("App::PropertyEnumeration","Blending", "Base", "Blending method").Blending = ["Average","Blend","Rail1","Rail2"] - obj.addProperty("App::PropertyPlacement", "Placement", "Base", "Placement") - obj.addProperty("App::PropertyFloatConstraint", "Scale1", "Edge1", "Scale of blend curve") - obj.addProperty("App::PropertyEnumeration", "Continuity1","Edge1", "Continuity").Continuity1=["C0","G1","G2","G3","G4"] - obj.addProperty("App::PropertyFloatConstraint", "Scale2", "Edge2", "Scale of blend curve") - obj.addProperty("App::PropertyEnumeration", "Continuity2","Edge2", "Continuity").Continuity2=["C0","G1","G2","G3","G4"] - obj.addProperty("App::PropertyInteger", "ProfileSamples", "BlendSurface", "Profile Samples") - obj.addProperty("App::PropertyInteger", "RailSamples", "BlendSurface", "Edge Samples") - obj.addProperty("App::PropertyBool", "Untwist", "BlendSurface", "Untwist surface") - obj.addProperty("App::PropertyVectorList", "Points", "BlendSurface", "Points") - obj.addProperty("App::PropertyVectorList", "ScaleList1", "BlendSurface", "Variable scale 1: list of vectors(parameter, scale1, 0)") - obj.addProperty("App::PropertyVectorList", "ScaleList2", "BlendSurface", "Variable scale 2: list of vectors(parameter, scale2, 0)") + obj.addProperty("App::PropertyLink", "Edge1", "Base", QT_TRANSLATE_NOOP("App::Property", "First edge")) + obj.addProperty("App::PropertyLink", "Edge2", "Base", QT_TRANSLATE_NOOP("App::Property", "Second edge")) + #obj.addProperty("App::PropertyEnumeration","Blending", "Base", QT_TRANSLATE_NOOP("App::Property", "Blending method")).Blending = ["Average","Blend","Rail1","Rail2"] + obj.addProperty("App::PropertyPlacement", "Placement", "Base", QT_TRANSLATE_NOOP("App::Property", "Placement")) + obj.addProperty("App::PropertyFloatConstraint", "Scale1", "Edge1", QT_TRANSLATE_NOOP("App::Property", "Scale of blend curve")) + obj.addProperty("App::PropertyEnumeration", "Continuity1","Edge1", QT_TRANSLATE_NOOP("App::Property", "Continuity")).Continuity1=["C0","G1","G2","G3","G4"] + obj.addProperty("App::PropertyFloatConstraint", "Scale2", "Edge2", QT_TRANSLATE_NOOP("App::Property", "Scale of blend curve")) + obj.addProperty("App::PropertyEnumeration", "Continuity2","Edge2", QT_TRANSLATE_NOOP("App::Property", "Continuity")).Continuity2=["C0","G1","G2","G3","G4"] + obj.addProperty("App::PropertyInteger", "ProfileSamples", "BlendSurface", QT_TRANSLATE_NOOP("App::Property", "Profile Samples")) + obj.addProperty("App::PropertyInteger", "RailSamples", "BlendSurface", QT_TRANSLATE_NOOP("App::Property", "Edge Samples")) + obj.addProperty("App::PropertyBool", "Untwist", "BlendSurface", QT_TRANSLATE_NOOP("App::Property", "Untwist surface")) + obj.addProperty("App::PropertyVectorList", "Points", "BlendSurface", QT_TRANSLATE_NOOP("App::Property", "Points")) + obj.addProperty("App::PropertyVectorList", "ScaleList1", "BlendSurface", QT_TRANSLATE_NOOP("App::Property", "Variable scale 1: list of vectors(parameter, scale1, 0)")) + obj.addProperty("App::PropertyVectorList", "ScaleList2", "BlendSurface", QT_TRANSLATE_NOOP("App::Property", "Variable scale 2: list of vectors(parameter, scale2, 0)")) obj.Continuity1 = "G2" obj.Continuity2 = "G2" @@ -191,7 +191,7 @@ def attach(self, vobj): ##vobj.DisplayMode = "Wireframe" #def updateData(self, fp, prop): - #FreeCAD.Console.PrintMessage("updateDate : " + str(prop) + "\n") + #FreeCAD.Console.PrintMessage(translate("Log", "updateDate : " + str(prop) + "\n")) #if len(fp.Points) == fp.RailSamples * fp.ProfileSamples : #self.coord.points = fp.Points #self.row.vertices = (fp.RailSamples, fp.ProfileSamples) @@ -205,7 +205,7 @@ def attach(self, vobj): #def onChanged(self, vp, prop): #"Here we can do something when a single property got changed" - #FreeCAD.Console.PrintMessage("Change property: " + str(prop) + "\n") + #FreeCAD.Console.PrintMessage(translate("Log", "Change property: " + str(prop) + "\n")) #def getDisplayModes(self,obj): #"Return a list of display modes." @@ -287,7 +287,7 @@ def onDelete(self, feature, subelements): # subelements is a tuple of strings self.Object.Edge1.ViewObject.show() self.Object.Edge2.ViewObject.show() except Exception as err: - FreeCAD.Console.PrintError("Error in onDelete: {0} \n".format(err)) + FreeCAD.Console.PrintError(translate("Log", "Error in onDelete: {0} \n")).format(err) return True class blendSurfCommand: @@ -302,7 +302,7 @@ def parseSel(self, selectionObject): def Activated(self): s = FreeCADGui.Selection.getSelection() if s == []: - FreeCAD.Console.PrintError("Select 2 CurveOnSurface objects.\n") + FreeCAD.Console.PrintError(translate("Log", "Select 2 CurveOnSurface objects.\n")) return myblSu = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Blend_Surface") diff --git a/freecad/Curves/blendSurfaceFP_new.py b/freecad/Curves/blendSurfaceFP_new.py index 208a570..53aaf47 100644 --- a/freecad/Curves/blendSurfaceFP_new.py +++ b/freecad/Curves/blendSurfaceFP_new.py @@ -24,21 +24,21 @@ class BlendSurfaceFP2: """Proxy of a BlendSurface FeaturePython object""" def __init__(self, obj): obj.addProperty("App::PropertyLinkSubList", "Sources", - "Base", "Edges and support faces") + "Base", QT_TRANSLATE_NOOP("App::Property", "Edges and support faces")) obj.addProperty("App::PropertyInteger", "Samples", - "Base", "Number of samples to generate surface") + "Base", QT_TRANSLATE_NOOP("App::Property", "Number of samples to generate surface")) obj.addProperty("App::PropertyInteger", "Continuity1", - "Continuity", "Continuity level with face of edge 1") + "Continuity", QT_TRANSLATE_NOOP("App::Property", "Continuity level with face of edge 1")) obj.addProperty("App::PropertyInteger", "Continuity2", - "Continuity", "Continuity level with face of edge 2") + "Continuity", QT_TRANSLATE_NOOP("App::Property", "Continuity level with face of edge 2")) obj.addProperty("App::PropertyEnumeration", "AutoScale", - "Scale", "Compute scales to get regular poles, or minimal curvature") + "Scale", QT_TRANSLATE_NOOP("App::Property", "Compute scales to get regular poles, or minimal curvature")) obj.addProperty("App::PropertyInteger", "ScaleSamples", - "Scale", "Number of samples for auto scaling") + "Scale", QT_TRANSLATE_NOOP("App::Property", "Number of samples for auto scaling")) obj.addProperty("App::PropertyFloatList", "Scale1", - "Scale", "Scale values along edge 1") + "Scale", QT_TRANSLATE_NOOP("App::Property", "Scale values along edge 1")) obj.addProperty("App::PropertyFloatList", "Scale2", - "Scale", "Scale values along edge 2") + "Scale", QT_TRANSLATE_NOOP("App::Property", "Scale values along edge 2")) obj.ScaleSamples = 3 obj.Samples = 20 obj.Continuity1 = 2 @@ -144,7 +144,7 @@ def Activated(self): if sources: self.makeFeature(sources) else: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) def IsActive(self): if FreeCAD.ActiveDocument: diff --git a/freecad/Curves/blend_curve.py b/freecad/Curves/blend_curve.py index 511cbfa..9a0a273 100755 --- a/freecad/Curves/blend_curve.py +++ b/freecad/Curves/blend_curve.py @@ -701,7 +701,7 @@ def get_offset_curve2d(self, dist=0.1): if len(c) == 3: cos.append(c[0].toBSpline(c[1], c[2])) else: - FreeCAD.Console.PrintError("failed to extract 2D geometry") + FreeCAD.Console.PrintError(translate("Log", "failed to extract 2D geometry")) if e.isPartner(self._edge): idx = n diff --git a/freecad/Curves/comp_spring.py b/freecad/Curves/comp_spring.py index 7cb666a..8f1a64a 100644 --- a/freecad/Curves/comp_spring.py +++ b/freecad/Curves/comp_spring.py @@ -1,6 +1,9 @@ # -*- coding: utf-8 -*- -__title__ = "Compression Spring" +import FreeCAD + +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" __doc__ = """Parametric Compression Spring""" @@ -95,13 +98,48 @@ class CompSpringFP: def __init__(self, obj): """Add the properties""" - obj.addProperty("App::PropertyFloat", "Length", "CompSpring", "Spring Length").Length = 10.0 - obj.addProperty("App::PropertyInteger", "Turns", "CompSpring", "Number of turns").Turns = 5 - obj.addProperty("App::PropertyFloat", "WireDiameter", "CompSpring", "Diameter of the spring wire").WireDiameter = 0.5 - obj.addProperty("App::PropertyFloat", "Diameter", "CompSpring", "Diameter of the spring").Diameter = 4.0 - obj.addProperty("App::PropertyInteger", "Flatness", "Setting", "Flatness of spring extremities from 0 to 4").Flatness = 0 - obj.addProperty("App::PropertyBool", "WireOutput", "Setting", "Output a wire shape").WireOutput = True - obj.addProperty("App::PropertyBool", "ReverseHelix", "CompSpring", "Left hand if true").ReverseHelix = False + obj.addProperty( + "App::PropertyFloat", + "Length", + "CompSpring", + QT_TRANSLATE_NOOP("App::Property", "Spring Length"), + ).Length = 10.0 + obj.addProperty( + "App::PropertyInteger", + "Turns", + "CompSpring", + QT_TRANSLATE_NOOP("App::Property", "Number of turns"), + ).Turns = 5 + obj.addProperty( + "App::PropertyFloat", + "WireDiameter", + "CompSpring", + QT_TRANSLATE_NOOP("App::Property", "Diameter of the spring wire"), + ).WireDiameter = 0.5 + obj.addProperty( + "App::PropertyFloat", + "Diameter", + "CompSpring", + QT_TRANSLATE_NOOP("App::Property", "Diameter of the spring"), + ).Diameter = 4.0 + obj.addProperty( + "App::PropertyInteger", + "Flatness", + "Setting", + QT_TRANSLATE_NOOP("App::Property", "Flatness of spring extremities from 0 to 4"), + ).Flatness = 0 + obj.addProperty( + "App::PropertyBool", + "WireOutput", + "Setting", + QT_TRANSLATE_NOOP("App::Property", "Output a wire shape"), + ).WireOutput = True + obj.addProperty( + "App::PropertyBool", + "ReverseHelix", + "CompSpring", + QT_TRANSLATE_NOOP("App::Property", "Left hand if true"), + ).ReverseHelix = False obj.Proxy = self def spring(self, obj): diff --git a/freecad/Curves/continuity_check.py b/freecad/Curves/continuity_check.py index b6e812c..382c2fb 100644 --- a/freecad/Curves/continuity_check.py +++ b/freecad/Curves/continuity_check.py @@ -132,13 +132,13 @@ class ContinuityCheckerFP: def __init__(self, obj): """Add the properties""" obj.addProperty("App::PropertyLinkList", "Sources", - "Base", "The list of seam edges to check") + "Base", QT_TRANSLATE_NOOP("App::Property", "The list of seam edges to check")) obj.addProperty("App::PropertyInteger", "Samples", - "Settings", "Number of test samples on edge") + "Settings", QT_TRANSLATE_NOOP("App::Property", "Number of test samples on edge")) obj.addProperty("App::PropertyInteger", "Lines", - "Settings", "Number of test lines on each sample") + "Settings", QT_TRANSLATE_NOOP("App::Property", "Number of test lines on each sample")) obj.addProperty("App::PropertyFloat", "Tolerance", - "Settings", "Continuity tolerance") + "Settings", QT_TRANSLATE_NOOP("App::Property", "Continuity tolerance")) obj.Proxy = self def execute(self, obj): @@ -186,7 +186,7 @@ def makeFeature(self, sel=None): def Activated(self): sel = FreeCADGui.Selection.getSelection() if sel == []: - FreeCAD.Console.PrintError("Select something first !\n") + FreeCAD.Console.PrintError(translate("Log", "Select something first !\n")) else: self.makeFeature(sel) diff --git a/freecad/Curves/curveExtend.py b/freecad/Curves/curveExtend.py index d30bee7..ff1ff76 100644 --- a/freecad/Curves/curveExtend.py +++ b/freecad/Curves/curveExtend.py @@ -15,7 +15,7 @@ def getTrimmedCurve(e): error(f"CurveExtend : Nurbs conversion error\n{exc}\n") c = e.Curve.toBSpline() if (not e.FirstParameter == c.FirstParameter) or (not e.LastParameter == c.LastParameter): - FreeCAD.Console.PrintWarning("Segmenting input curve\n") + FreeCAD.Console.PrintWarning(translate("Log", "Segmenting input curve\n")) c.segment(e.FirstParameter, e.LastParameter) return c diff --git a/freecad/Curves/curveExtendFP.py b/freecad/Curves/curveExtendFP.py index 2a3220f..5ec8326 100644 --- a/freecad/Curves/curveExtendFP.py +++ b/freecad/Curves/curveExtendFP.py @@ -15,22 +15,33 @@ from . import ICONPATH from . import curveExtend -TOOL_ICON = os.path.join(ICONPATH, 'extendcurve.svg') +TOOL_ICON = os.path.join(ICONPATH, "extendcurve.svg") # debug = _utils.debug debug = _utils.doNothing class extend: """Extends the selected edge""" - def __init__(self, obj): - obj.addProperty("App::PropertyLinkSub", "Edge", "Base", "Input edge to extend") - obj.addProperty("App::PropertyEnumeration", "Output", "Base", "Output shape").Output = ["SingleEdge", "Wire"] - - obj.addProperty("App::PropertyFloat", "LengthStart", "Beginning", "Start Extension Length").LengthStart = 10.0 - obj.addProperty("App::PropertyEnumeration", "TypeStart", "Beginning", "Start Extension type").TypeStart = ["Straight", "G2 curve"] - obj.addProperty("App::PropertyFloat", "LengthEnd", "End", "End Extension Length").LengthEnd = 10.0 - obj.addProperty("App::PropertyEnumeration", "TypeEnd", "End", "End Extension type").TypeEnd = ["Straight", "G2 curve"] + def __init__(self, obj): + obj.addProperty("App::PropertyLinkSub", "Edge", "Base", QT_TRANSLATE_NOOP("App::Property", "Input edge to extend")) + obj.addProperty( + "App::PropertyEnumeration", "Output", "Base", QT_TRANSLATE_NOOP("App::Property", "Output shape") + ).Output = ["SingleEdge", "Wire"] + + obj.addProperty( + "App::PropertyFloat", "LengthStart", "Beginning", QT_TRANSLATE_NOOP("App::Property", "Start Extension Length") + ).LengthStart = 10.0 + obj.addProperty( + "App::PropertyEnumeration", "TypeStart", "Beginning", QT_TRANSLATE_NOOP("App::Property", "Start Extension type") + ).TypeStart = ["Straight", "G2 curve"] + + obj.addProperty( + "App::PropertyFloat", "LengthEnd", "End", QT_TRANSLATE_NOOP("App::Property", "End Extension Length") + ).LengthEnd = 10.0 + obj.addProperty( + "App::PropertyEnumeration", "TypeEnd", "End", QT_TRANSLATE_NOOP("App::Property", "End Extension type") + ).TypeEnd = ["Straight", "G2 curve"] obj.TypeStart = "Straight" obj.TypeEnd = "Straight" @@ -96,7 +107,8 @@ def claimChildren(self): def onDelete(self, feature, subelements): return True - if FreeCAD.Version()[0] == '0' and '.'.join(FreeCAD.Version()[1:3]) >= '21.2': + if FreeCAD.Version()[0] == "0" and ".".join(FreeCAD.Version()[1:3]) >= "21.2": + def dumps(self): return {"name": self.Object.Name} @@ -105,6 +117,7 @@ def loads(self, state): return None else: + def __getstate__(self): return {"name": self.Object.Name} @@ -115,10 +128,13 @@ def __setstate__(self, state): class extendCommand: """Extends the selected edge""" + def makeExtendFeature(self, source): if source is not []: for o in source: - extCurve = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "ExtendedCurve") + extCurve = FreeCAD.ActiveDocument.addObject( + "Part::FeaturePython", "ExtendedCurve" + ) extend(extCurve) extCurve.Edge = o extendVP(extCurve.ViewObject) @@ -130,7 +146,7 @@ def Activated(self): edges = [] sel = FreeCADGui.Selection.getSelectionEx() if sel == []: - FreeCAD.Console.PrintError("Select the edges to extend first !\n") + FreeCAD.Console.PrintError(translate("Log", "Select the edges to extend first !\n")) for selobj in sel: if selobj.HasSubObjects: for i in range(len(selobj.SubObjects)): @@ -147,9 +163,13 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

Usage :
{}".format( + __doc__, "
".join(__usage__.splitlines()) + ), + } -FreeCADGui.addCommand('extend', extendCommand()) +FreeCADGui.addCommand("Curves_ExtendCurve", extendCommand()) diff --git a/freecad/Curves/curveOnSurface.py b/freecad/Curves/curveOnSurface.py index b7353b6..77b161c 100644 --- a/freecad/Curves/curveOnSurface.py +++ b/freecad/Curves/curveOnSurface.py @@ -421,7 +421,7 @@ def get_offset_curve2d(self, dist=0.1): if len(c) == 3: cos.append(c[0].toBSpline(c[1], c[2])) else: - FreeCAD.Console.PrintError("failed to extract 2D geometry") + FreeCAD.Console.PrintError(translate("Log", "failed to extract 2D geometry")) if e.isPartner(self.edge): idx = n @@ -445,8 +445,8 @@ def get_offset_curve2d(self, dist=0.1): def get_cross_curve(self, off, u=0): """returns cross-curve from offsetCurve off to COS at param u""" if u < self.firstParameter or u > self.lastParameter: - FreeCAD.Console.PrintError("Curve_on_surface.get_cross_curve : parameter out of range\n") - FreeCAD.Console.PrintError("{} is not in [{},{}]\n".format(u, self.firstParameter, self.lastParameter)) + FreeCAD.Console.PrintError(translate("Log", "Curve_on_surface.get_cross_curve : parameter out of range\n")) + FreeCAD.Console.PrintError(translate("Log", "{} is not in [{},{}]\n")).format(u, self.firstParameter, self.lastParameter) if u < self.firstParameter: u = self.firstParameter elif u > self.lastParameter: @@ -458,7 +458,7 @@ def get_cross_curve(self, off, u=0): ls = Part.Geom2d.Line2dSegment(p1, p2) sh = ls.toShape(self.face.Surface) # sh = sh.transformGeometry(self.face.Placement.toMatrix()).Edges[0] - FreeCAD.Console.PrintMessage(" {} - {}\n".format(self.edge.Curve, str(sh.distToShape(self.edge)[0]))) + FreeCAD.Console.PrintMessage(translate("Log", " {} - {}\n")).format(self.edge.Curve, str(sh.distToShape(self.edge)[0])) # d,pts,info = sh.distToShape(self.edge) # if d > 1e-8: # bs = sh.Edges[0].Curve.toBSpline() diff --git a/freecad/Curves/curveOnSurfaceFP.py b/freecad/Curves/curveOnSurfaceFP.py index e182d82..14cdbd8 100644 --- a/freecad/Curves/curveOnSurfaceFP.py +++ b/freecad/Curves/curveOnSurfaceFP.py @@ -21,20 +21,80 @@ class cosFP: """Creates a parametric curve on surface object.""" def __init__(self, obj): - ''' Add the properties ''' - obj.addProperty("App::PropertyLinkSub", "InputEdge", "CurveOnSurface", "Input edge") - obj.addProperty("App::PropertyLinkSub", "Face", "CurveOnSurface", "Support face") - obj.addProperty("App::PropertyFloat", "Tolerance", "CurveOnSurface", "Tolerance").Tolerance=0.0001 - obj.addProperty("App::PropertyBool", "ReverseTangent", "Orientation", "Reverse tangent").ReverseTangent = False - obj.addProperty("App::PropertyBool", "ReverseNormal", "Orientation", "Reverse normal").ReverseNormal = False - obj.addProperty("App::PropertyBool", "ReverseBinormal","Orientation", "Reverse binormal").ReverseBinormal = False - #obj.addProperty("Part::PropertyPartShape", "Shape", "Base", "Shape") - obj.addProperty("App::PropertyEnumeration","Output", "CurveOnSurface", "Output type").Output = ["Curve only","Normal face","Binormal face"] - obj.addProperty("App::PropertyInteger", "Samples", "CurveOnSurface", "Number of samples").Samples=100 - obj.addProperty("App::PropertyDistance", "FaceWidth", "CurveOnSurface", "Width of the output face").FaceWidth='1mm' - obj.addProperty("App::PropertyBool", "Symmetric", "CurveOnSurface", "Face symmetric across curve").Symmetric = False - obj.addProperty("App::PropertyBool", "Closed", "CurveOnSurface", "Close the curve").Closed = False - obj.addProperty("App::PropertyBool", "Reverse", "CurveOnSurface", "Reverse the parametric orientation of the curve").Reverse = False + """Add the properties""" + obj.addProperty( + "App::PropertyLinkSub", + "InputEdge", + "CurveOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Input edge"), + ) + obj.addProperty( + "App::PropertyLinkSub", + "Face", + "CurveOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Support face"), + ) + obj.addProperty( + "App::PropertyFloat", + "Tolerance", + "CurveOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Tolerance"), + ).Tolerance = 0.0001 + obj.addProperty( + "App::PropertyBool", + "ReverseTangent", + "Orientation", + QT_TRANSLATE_NOOP("App::Property", "Reverse tangent"), + ).ReverseTangent = False + obj.addProperty( + "App::PropertyBool", + "ReverseNormal", + "Orientation", + QT_TRANSLATE_NOOP("App::Property", "Reverse normal"), + ).ReverseNormal = False + obj.addProperty( + "App::PropertyBool", + "ReverseBinormal", + "Orientation", + QT_TRANSLATE_NOOP("App::Property", "Reverse binormal"), + ).ReverseBinormal = False + # obj.addProperty("Part::PropertyPartShape", "Shape", "Base", QT_TRANSLATE_NOOP("App::Property", "Shape")) + obj.addProperty( + "App::PropertyEnumeration", + "Output", + "CurveOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Output type"), + ).Output = ["Curve only", "Normal face", "Binormal face"] + obj.addProperty( + "App::PropertyInteger", + "Samples", + "CurveOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Number of samples"), + ).Samples = 100 + obj.addProperty( + "App::PropertyDistance", + "FaceWidth", + "CurveOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Width of the output face"), + ).FaceWidth = "1mm" + obj.addProperty( + "App::PropertyBool", + "Symmetric", + "CurveOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Face symmetric across curve"), + ).Symmetric = False + obj.addProperty( + "App::PropertyBool", + "Closed", + "CurveOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Close the curve"), + ).Closed = False + obj.addProperty( + "App::PropertyBool", + "Reverse", + "CurveOnSurface", + QT_TRANSLATE_NOOP("App::Property", "Reverse the parametric orientation of the curve"), + ).Reverse = False obj.Output = "Curve only" obj.Proxy = self @@ -104,7 +164,7 @@ def onDelete(self, feature, subelements): try: self.Object.InputEdge[0].ViewObject.Visibility=True except Exception as err: - FreeCAD.Console.PrintError("Error in onDelete: {0} \n".format(err)) + FreeCAD.Console.PrintError(translate("Log", "Error in onDelete: {0} \n")).format(err) return(True) @@ -116,7 +176,7 @@ def Activated(self): face = None sel = FreeCADGui.Selection.getSelectionEx('',0) if sel == []: - FreeCAD.Console.PrintError("Select an edge and its supporting face \n") + FreeCAD.Console.PrintError(translate("Log", "Select an edge and its supporting face \n")) for selobj in sel: for path in selobj.SubElementNames if selobj.SubElementNames else ['']: shape = selobj.Object.getSubObject(path) @@ -140,8 +200,9 @@ def Activated(self): cos.ViewObject.LineColor = (1.0,0.67,0.0) cos.ViewObject.LineWidth = 3.0 else: - FreeCAD.Console.PrintError("Select an edge and its supporting face \n") - + FreeCAD.Console.PrintError( + translate("Log", "Select an edge and its supporting face \n") + ) def GetResources(self): return {'Pixmap': TOOL_ICON, diff --git a/freecad/Curves/curve_to_script.py b/freecad/Curves/curve_to_script.py index a372de0..499feee 100644 --- a/freecad/Curves/curve_to_script.py +++ b/freecad/Curves/curve_to_script.py @@ -103,7 +103,7 @@ def Activated(self): nurbs_to_script(i, geom) i += 1 if i == 0: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) def IsActive(self): if FreeCAD.ActiveDocument: diff --git a/freecad/Curves/curves_to_surface.py b/freecad/Curves/curves_to_surface.py index 6597344..8aa736a 100644 --- a/freecad/Curves/curves_to_surface.py +++ b/freecad/Curves/curves_to_surface.py @@ -204,7 +204,7 @@ def orient_surface(surf1, surf2, tol=1e-7): """ def match(p1, p2): return p1.distanceToPoint(p2) < tol - FreeCAD.Console.PrintMessage("---\n") + FreeCAD.Console.PrintMessage(translate("Log", "---\n")) # surface params O, X, Y params = ((0.0, 0.0), (1.0, 0.0), (0.0, 1.0)) pts1 = [surf1.value(u, v) for u, v in params] @@ -213,12 +213,12 @@ def match(p1, p2): if match(pts1[0], pts2[0]): if match(pts1[1], pts2[2]): surf2.exchangeUV() - FreeCAD.Console.PrintMessage("exchange UV\n") + FreeCAD.Console.PrintMessage(translate("Log", "exchange UV\n")) return surf2 # O match X elif match(pts1[0], pts2[1]): # reverse U - FreeCAD.Console.PrintMessage("reverse U\n") + FreeCAD.Console.PrintMessage(translate("Log", "reverse U\n")) c = surf2.vIso(0.0) c.reverse() uknots = c.getKnots() @@ -239,13 +239,13 @@ def match(p1, p2): # Y match O if match(pts1[2], pts2[0]): nbs.exchangeUV() - FreeCAD.Console.PrintMessage("exchange UV\n") + FreeCAD.Console.PrintMessage(translate("Log", "exchange UV\n")) surf2 = nbs return nbs # O match Y elif match(pts1[0], pts2[1]): # reverse V - FreeCAD.Console.PrintMessage("reverse V\n") + FreeCAD.Console.PrintMessage(translate("Log", "reverse V\n")) c = surf2.uIso(0.0) c.reverse() vknots = c.getKnots() @@ -266,7 +266,7 @@ def match(p1, p2): # X match O if match(pts1[2], pts2[0]): nbs.exchangeUV() - FreeCAD.Console.PrintMessage("exchange UV\n") + FreeCAD.Console.PrintMessage(translate("Log", "exchange UV\n")) surf2 = nbs return nbs else: @@ -689,10 +689,10 @@ def sort_curves(self, s): for i in intersect: print(i) if abs(intersect[0][0]) > self.tol3d: - FreeCAD.Console.PrintMessage("Inserting flat profile at 0.0\n") + FreeCAD.Console.PrintMessage(translate("Log", "Inserting flat profile at 0.0\n")) intersect.insert(0, (0.0, s.vIso(0.0))) if abs(intersect[-1][0] - 1.0) > self.tol3d: - FreeCAD.Console.PrintMessage("Inserting flat profile at 1.0\n") + FreeCAD.Console.PrintMessage(translate("Log", "Inserting flat profile at 1.0\n")) intersect.append((1.0, s.vIso(1.0))) params = [tup[0] for tup in intersect] curves = [tup[1] for tup in intersect] diff --git a/freecad/Curves/gordon.py b/freecad/Curves/gordon.py index 2703083..3e8a132 100644 --- a/freecad/Curves/gordon.py +++ b/freecad/Curves/gordon.py @@ -54,15 +54,15 @@ def debug(o): u = o.uIso(o.getUKnot(1)) debug(u) except Part.OCCError: - FreeCAD.Console.PrintError("Failed to compute uIso curve\n") + FreeCAD.Console.PrintError(translate("Log", "Failed to compute uIso curve\n")) try: v = o.vIso(o.getVKnot(1)) debug(v) except Part.OCCError: - FreeCAD.Console.PrintError("Failed to compute vIso curve\n") + FreeCAD.Console.PrintError(translate("Log", "Failed to compute vIso curve\n")) warn("************\n") else: - FreeCAD.Console.PrintMessage("{}\n".format(str(o))) + FreeCAD.Console.PrintMessage(translate("Log", "{}\n")).format(str(o)) def find(val, array, tol=1e-5): diff --git a/freecad/Curves/gordonFP.py b/freecad/Curves/gordonFP.py index 7cee9bc..4efe0d2 100644 --- a/freecad/Curves/gordonFP.py +++ b/freecad/Curves/gordonFP.py @@ -1,5 +1,10 @@ # -*- coding: utf-8 -*- +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + __title__ = "Parametric Gordon surface" __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" @@ -24,25 +29,25 @@ def debug(o): if not DEBUG: return if isinstance(o, Part.BSplineCurve): - FreeCAD.Console.PrintWarning("\nBSplineCurve\n") + FreeCAD.Console.PrintWarning(translate("Log", "\nBSplineCurve\n")) FreeCAD.Console.PrintWarning("Degree: %d\n" % (o.Degree)) FreeCAD.Console.PrintWarning("NbPoles: %d\n" % (o.NbPoles)) FreeCAD.Console.PrintWarning("Knots: %d (%0.2f - %0.2f)\n" % (o.NbKnots, o.FirstParameter, o.LastParameter)) FreeCAD.Console.PrintWarning("Mults: %s\n" % (o.getMultiplicities())) FreeCAD.Console.PrintWarning("Periodic: %s\n" % (o.isPeriodic())) elif isinstance(o, Part.BSplineSurface): - FreeCAD.Console.PrintWarning("\nBSplineSurface\n************\n") + FreeCAD.Console.PrintWarning(translate("Log", "\nBSplineSurface\n************\n")) try: u = o.uIso(o.UKnotSequence[0]) debug(u) except Part.OCCError: - FreeCAD.Console.PrintError("Failed to compute uIso curve\n") + FreeCAD.Console.PrintError(translate("Log", "Failed to compute uIso curve\n")) try: v = o.vIso(o.VKnotSequence[0]) debug(v) except Part.OCCError: - FreeCAD.Console.PrintError("Failed to compute vIso curve\n") - FreeCAD.Console.PrintWarning("************\n") + FreeCAD.Console.PrintError(translate("Log", "Failed to compute vIso curve\n")) + FreeCAD.Console.PrintWarning(translate("Log", "************\n")) else: FreeCAD.Console.PrintMessage("%s\n" % o) @@ -52,14 +57,54 @@ class gordonFP: def __init__(self, obj): """Add the properties""" - obj.addProperty("App::PropertyLinkList", "Sources", "Gordon", "Curve network") - obj.addProperty("App::PropertyFloat", "Tol3D", "Gordon", "3D tolerance").Tol3D = 1e-2 - obj.addProperty("App::PropertyFloat", "Tol2D", "Gordon", "Parametric tolerance").Tol2D = 1e-5 - obj.addProperty("App::PropertyInteger", "MaxCtrlPts", "Gordon", "Max Number of control points").MaxCtrlPts = 80 - obj.addProperty("App::PropertyEnumeration", "Output", "Base", "Output type").Output = ["Surface", "Wireframe"] - obj.addProperty("App::PropertyInteger", "SamplesU", "Wireframe", "Number of samples in U direction").SamplesU = 16 - obj.addProperty("App::PropertyInteger", "SamplesV", "Wireframe", "Number of samples in V direction").SamplesV = 16 - obj.addProperty("App::PropertyBool", "FlipNormal", "Surface", "Flip surface normal").FlipNormal = False + obj.addProperty( + "App::PropertyLinkList", + "Sources", + "Gordon", + QT_TRANSLATE_NOOP("App::Property", "Curve network"), + ) + obj.addProperty( + "App::PropertyFloat", + "Tol3D", + "Gordon", + QT_TRANSLATE_NOOP("App::Property", "3D tolerance"), + ).Tol3D = 1e-2 + obj.addProperty( + "App::PropertyFloat", + "Tol2D", + "Gordon", + QT_TRANSLATE_NOOP("App::Property", "Parametric tolerance"), + ).Tol2D = 1e-5 + obj.addProperty( + "App::PropertyInteger", + "MaxCtrlPts", + "Gordon", + QT_TRANSLATE_NOOP("App::Property", "Max Number of control points"), + ).MaxCtrlPts = 80 + obj.addProperty( + "App::PropertyEnumeration", + "Output", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Output type"), + ).Output = ["Surface", "Wireframe"] + obj.addProperty( + "App::PropertyInteger", + "SamplesU", + "Wireframe", + QT_TRANSLATE_NOOP("App::Property", "Number of samples in U direction"), + ).SamplesU = 16 + obj.addProperty( + "App::PropertyInteger", + "SamplesV", + "Wireframe", + QT_TRANSLATE_NOOP("App::Property", "Number of samples in V direction"), + ).SamplesV = 16 + obj.addProperty( + "App::PropertyBool", + "FlipNormal", + "Surface", + QT_TRANSLATE_NOOP("App::Property", "Flip surface normal"), + ).FlipNormal = False obj.Output = "Surface" obj.setEditorMode("Tol2D", 2) obj.setEditorMode("SamplesU", 2) @@ -206,7 +251,7 @@ def makeGordonFeature(self, source): def Activated(self): sel = FreeCADGui.Selection.getSelection() if sel == []: - FreeCAD.Console.PrintError("Select a curve network !\n") + FreeCAD.Console.PrintError(translate("Log", "Select a curve network !\n")) else: self.makeGordonFeature(sel) diff --git a/freecad/Curves/gordon_profile_FP.py b/freecad/Curves/gordon_profile_FP.py index 3659f47..f091c2b 100644 --- a/freecad/Curves/gordon_profile_FP.py +++ b/freecad/Curves/gordon_profile_FP.py @@ -47,15 +47,15 @@ class GordonProfileFP: """Creates an editable interpolation curve""" def __init__(self, obj, s, d, t): """Add the properties""" - obj.addProperty("App::PropertyLinkSubList", "Support", "Profile", "Constraint shapes").Support = s - obj.addProperty("App::PropertyFloatConstraint", "Parametrization", "Profile", "Parametrization factor") - obj.addProperty("App::PropertyFloat", "Tolerance", "Profile", "Tolerance").Tolerance = 1e-7 - obj.addProperty("App::PropertyBool", "Periodic", "Profile", "Periodic curve").Periodic = False - obj.addProperty("App::PropertyVectorList", "Data", "Profile", "Data list").Data = d - obj.addProperty("App::PropertyVectorList", "Tangents", "Profile", "Tangents list") - obj.addProperty("App::PropertyBoolList", "Flags", "Profile", "Tangent flags") - obj.addProperty("App::PropertyIntegerList", "DataType", "Profile", "Types of interpolated points").DataType = t - obj.addProperty("App::PropertyBoolList", "LinearSegments", "Profile", "Linear segment flags") + obj.addProperty("App::PropertyLinkSubList", "Support", "Profile", QT_TRANSLATE_NOOP("App::Property", "Constraint shapes")).Support = s + obj.addProperty("App::PropertyFloatConstraint", "Parametrization", "Profile", QT_TRANSLATE_NOOP("App::Property", "Parametrization factor")) + obj.addProperty("App::PropertyFloat", "Tolerance", "Profile", QT_TRANSLATE_NOOP("App::Property", "Tolerance")).Tolerance = 1e-7 + obj.addProperty("App::PropertyBool", "Periodic", "Profile", QT_TRANSLATE_NOOP("App::Property", "Periodic curve")).Periodic = False + obj.addProperty("App::PropertyVectorList", "Data", "Profile", QT_TRANSLATE_NOOP("App::Property", "Data list")).Data = d + obj.addProperty("App::PropertyVectorList", "Tangents", "Profile", QT_TRANSLATE_NOOP("App::Property", "Tangents list")) + obj.addProperty("App::PropertyBoolList", "Flags", "Profile", QT_TRANSLATE_NOOP("App::Property", "Tangent flags")) + obj.addProperty("App::PropertyIntegerList", "DataType", "Profile", QT_TRANSLATE_NOOP("App::Property", "Types of interpolated points")).DataType = t + obj.addProperty("App::PropertyBoolList", "LinearSegments", "Profile", QT_TRANSLATE_NOOP("App::Property", "Linear segment flags")) obj.Parametrization = (1.0, 0.0, 1.0, 0.05) obj.Proxy = self @@ -84,7 +84,7 @@ def get_points(self, fp, stretch=True): touched = False shapes = self.get_shapes(fp) if not len(fp.Data) == len(fp.DataType): - FreeCAD.Console.PrintError("Gordon Profile : Data and DataType mismatch\n") + FreeCAD.Console.PrintError(translate("Log", "Gordon Profile : Data and DataType mismatch\n")) return(None) pts = list() shape_idx = 0 @@ -136,11 +136,11 @@ def execute(self, obj): except AttributeError: pass except: - FreeCAD.Console.PrintWarning("execute is disabled during editing\n") + FreeCAD.Console.PrintWarning(translate("Log", "execute is disabled during editing\n")) pts = self.get_points(obj) if pts: if len(pts) < 2: - FreeCAD.Console.PrintError("{} : Not enough points\n".format(obj.Label)) + FreeCAD.Console.PrintError(translate("Log", "{} : Not enough points\n")).format(obj.Label) return False else: obj.Data = pts diff --git a/freecad/Curves/graphics.py b/freecad/Curves/graphics.py index 8f3e212..3737aef 100644 --- a/freecad/Curves/graphics.py +++ b/freecad/Curves/graphics.py @@ -443,7 +443,7 @@ def dragCB(self, attr, event_callback, force=False): elif event.getState() == coin.SoMouseButtonEvent.DOWN: s = "down" # import FreeCAD - # FreeCAD.Console.PrintMessage("{} {}\n".format(b,s)) + # FreeCAD.Console.PrintMessage(translate("Log", "{} {}\n")).format(b,s) if ((type(event) == coin.SoMouseButtonEvent and event.getState() == coin.SoMouseButtonEvent.UP and event.getButton() == coin.SoMouseButtonEvent.BUTTON1) or diff --git a/freecad/Curves/grid.py b/freecad/Curves/grid.py index 0249819..30bf26e 100644 --- a/freecad/Curves/grid.py +++ b/freecad/Curves/grid.py @@ -303,7 +303,7 @@ def buildGrid(self): class gridObject: def __init__(self, obj): obj.Proxy = self - obj.addProperty("App::PropertyPlacement", "Placement", "Base", "Placement") + obj.addProperty("App::PropertyPlacement", "Placement", "Base", QT_TRANSLATE_NOOP("App::Property", "Placement")) def execute(self, obj): return() def onChanged(self, fp, prop): @@ -317,15 +317,15 @@ def onChanged(self, fp, prop): class gridVP: def __init__(self, obj ): - obj.addProperty("App::PropertyDistance", "Total", "Size", "Size of a grid quadrant").Total = '100mm' - obj.addProperty("App::PropertyDistance", "Subdivision", "Size", "Size of subdivisions").Subdivision = '10mm' - obj.addProperty("App::PropertyFloat", "XY_Attenuation", "View", "XY plane attenuation").XY_Attenuation = 2.0 - obj.addProperty("App::PropertyFloat", "XZ_Attenuation", "View", "XZ plane attenuation").XZ_Attenuation = 50.0 - obj.addProperty("App::PropertyFloat", "YZ_Attenuation", "View", "YZ plane attenuation").YZ_Attenuation = 50.0 - obj.addProperty("App::PropertyFloat", "XY_Visibility", "View", "XY plane max visibility").XY_Visibility = 1.0 - obj.addProperty("App::PropertyFloat", "XZ_Visibility", "View", "XZ plane max visibility").XZ_Visibility = 0.5 - obj.addProperty("App::PropertyFloat", "YZ_Visibility", "View", "YZ plane max visibility").YZ_Visibility = 0.5 - obj.addProperty("App::PropertyColor", "GridColor", "Color", "Grid Color").GridColor = (0.5,0.5,0.5) + obj.addProperty("App::PropertyDistance", "Total", "Size", QT_TRANSLATE_NOOP("App::Property", "Size of a grid quadrant")).Total = '100mm' + obj.addProperty("App::PropertyDistance", "Subdivision", "Size", QT_TRANSLATE_NOOP("App::Property", "Size of subdivisions")).Subdivision = '10mm' + obj.addProperty("App::PropertyFloat", "XY_Attenuation", "View", QT_TRANSLATE_NOOP("App::Property", "XY plane attenuation")).XY_Attenuation = 2.0 + obj.addProperty("App::PropertyFloat", "XZ_Attenuation", "View", QT_TRANSLATE_NOOP("App::Property", "XZ plane attenuation")).XZ_Attenuation = 50.0 + obj.addProperty("App::PropertyFloat", "YZ_Attenuation", "View", QT_TRANSLATE_NOOP("App::Property", "YZ plane attenuation")).YZ_Attenuation = 50.0 + obj.addProperty("App::PropertyFloat", "XY_Visibility", "View", QT_TRANSLATE_NOOP("App::Property", "XY plane max visibility")).XY_Visibility = 1.0 + obj.addProperty("App::PropertyFloat", "XZ_Visibility", "View", QT_TRANSLATE_NOOP("App::Property", "XZ plane max visibility")).XZ_Visibility = 0.5 + obj.addProperty("App::PropertyFloat", "YZ_Visibility", "View", QT_TRANSLATE_NOOP("App::Property", "YZ plane max visibility")).YZ_Visibility = 0.5 + obj.addProperty("App::PropertyColor", "GridColor", "Color", QT_TRANSLATE_NOOP("App::Property", "Grid Color")).GridColor = (0.5,0.5,0.5) obj.Proxy = self def attach(self, obj): diff --git a/freecad/Curves/init_gui.py b/freecad/Curves/init_gui.py index c0547fe..b657481 100644 --- a/freecad/Curves/init_gui.py +++ b/freecad/Curves/init_gui.py @@ -1,13 +1,21 @@ import os + import FreeCADGui as Gui import FreeCAD as App -from . import ICONPATH +from . import ICONPATH, TRANSLATIONPATH + +translate = App.Qt.translate +QT_TRANSLATE_NOOP = App.Qt.QT_TRANSLATE_NOOP + +Gui.addLanguagePath(TRANSLATIONPATH) +Gui.updateLocale() class CurvesWorkbench(Gui.Workbench): """FreeCAD workbench that offers a collection of tools mainly related to Nurbs curves and surfaces.""" - MenuText = "Curves" - ToolTip = "a workbench dedicated to curves and surfaces" + + MenuText = translate("Workbench", "Curves") + ToolTip = translate("Workbench", "a workbench dedicated to curves and surfaces") Icon = os.path.join(ICONPATH, "blendSurf.svg") toolbox = [] @@ -117,12 +125,12 @@ def Initialize(self): "Curves_BsplineToConsole", ] - self.appendToolbar("Curves", curvelist) - self.appendToolbar("Surfaces", surflist) - self.appendToolbar("Misc.", misclist) - self.appendMenu("Curves", curvelist) - self.appendMenu("Surfaces", surflist) - self.appendMenu("Misc.", misclist) + self.appendToolbar(QT_TRANSLATE_NOOP("Workbench", "Curves"), curvelist) + self.appendToolbar(QT_TRANSLATE_NOOP("Workbench", "Surfaces"), surflist) + self.appendToolbar(QT_TRANSLATE_NOOP("Workbench", "Misc."), misclist) + self.appendMenu(QT_TRANSLATE_NOOP("Workbench", "Curves"), curvelist) + self.appendMenu(QT_TRANSLATE_NOOP("Workbench", "Surfaces"), surflist) + self.appendMenu(QT_TRANSLATE_NOOP("Workbench", "Misc."), misclist) def Activated(self): """This function is executed when the workbench is activated""" @@ -171,14 +179,14 @@ def ContextMenu(self, recipient): """This is executed whenever the user right-clicks on screen. recipient" will be either 'view' or 'tree'""" if recipient == "View": - self.appendContextMenu("Curves", contextlist) contextlist = [ "Curves_AdjacentFaces", "Curves_BsplineToConsole", ] # list of commands + self.appendContextMenu(QT_TRANSLATE_NOOP("Workbench", "Curves"), contextlist) elif recipient == "Tree": contextlist = [] # list of commands - self.appendContextMenu("Curves", contextlist) + self.appendContextMenu(QT_TRANSLATE_NOOP("Workbench", "Curves"), contextlist) def GetClassName(self): """This function is mandatory if this is a full python workbench""" diff --git a/freecad/Curves/interpolate.py b/freecad/Curves/interpolate.py index 0cbde8f..94bd10d 100644 --- a/freecad/Curves/interpolate.py +++ b/freecad/Curves/interpolate.py @@ -57,22 +57,102 @@ class Interpolate: def __init__(self, obj, source): ''' Add the properties ''' debug("\nInterpolate class Init\n") - obj.addProperty("App::PropertyLink", "Source", "General", "Source object that provides points to interpolate") - obj.addProperty("App::PropertyLinkSubList", "PointList", "General", "Point list to interpolate") - obj.addProperty("App::PropertyBool", "Periodic", "General", "Set the curve closed").Periodic = False - obj.addProperty("App::PropertyFloat", "Tolerance", "General", "Interpolation tolerance").Tolerance = 1e-7 - obj.addProperty("App::PropertyBool", "CustomTangents", "General", "User specified tangents").CustomTangents = False - obj.addProperty("App::PropertyBool", "DetectAligned", "General", "interpolate 3 aligned points with a line").DetectAligned = False - obj.addProperty("App::PropertyBool", "Polygonal", "General", "interpolate with a degree 1 polygonal curve").Polygonal = False - obj.addProperty("App::PropertyInteger", "StartOffset", "General", "Offset the start index of the point list").StartOffset = 0 - obj.addProperty("App::PropertyBool", "WireOutput", "Parameters", "outputs a wire or a single edge").WireOutput = False - obj.addProperty("App::PropertyFloatList", "Parameters", "Parameters", "Parameters of interpolated points") - obj.addProperty("App::PropertyEnumeration", "Parametrization","Parameters", "Parametrization type") - obj.addProperty("App::PropertyVectorList", "Tangents", "General", "Tangents at interpolated points") - obj.addProperty("App::PropertyBoolList", "TangentFlags", "General", "Activation flag of tangents") - obj.addProperty("App::PropertyLinkSub", "FaceSupport", "Spiral", "Face support of the spiral") - obj.addProperty("App::PropertyInteger", "UTurns", "Spiral", "Nb of turns between 2 points, in U direction").UTurns = 0 - obj.addProperty("App::PropertyInteger", "VTurns", "Spiral", "Nb of turns between 2 points, in V direction").VTurns = 0 + obj.addProperty( + "App::PropertyLink", + "Source", + "General", + QT_TRANSLATE_NOOP("App::Property", "Source object that provides points to interpolate"), + ) + obj.addProperty( + "App::PropertyLinkSubList", + "PointList", + "General", + QT_TRANSLATE_NOOP("App::Property", "Point list to interpolate"), + ) + obj.addProperty( + "App::PropertyBool", + "Periodic", + "General", + QT_TRANSLATE_NOOP("App::Property", "Set the curve closed"), + ).Periodic = False + obj.addProperty( + "App::PropertyFloat", + "Tolerance", + "General", + QT_TRANSLATE_NOOP("App::Property", "Interpolation tolerance"), + ).Tolerance = 1e-7 + obj.addProperty( + "App::PropertyBool", + "CustomTangents", + "General", + QT_TRANSLATE_NOOP("App::Property", "User specified tangents"), + ).CustomTangents = False + obj.addProperty( + "App::PropertyBool", + "DetectAligned", + "General", + QT_TRANSLATE_NOOP("App::Property", "interpolate 3 aligned points with a line"), + ).DetectAligned = False + obj.addProperty( + "App::PropertyBool", + "Polygonal", + "General", + QT_TRANSLATE_NOOP("App::Property", "interpolate with a degree 1 polygonal curve"), + ).Polygonal = False + obj.addProperty( + "App::PropertyInteger", + "StartOffset", + "General", + QT_TRANSLATE_NOOP("App::Property", "Offset the start index of the point list"), + ).StartOffset = 0 + obj.addProperty( + "App::PropertyBool", + "WireOutput", + "Parameters", + QT_TRANSLATE_NOOP("App::Property", "outputs a wire or a single edge"), + ).WireOutput = False + obj.addProperty( + "App::PropertyFloatList", + "Parameters", + "Parameters", + QT_TRANSLATE_NOOP("App::Property", "Parameters of interpolated points"), + ) + obj.addProperty( + "App::PropertyEnumeration", + "Parametrization", + "Parameters", + QT_TRANSLATE_NOOP("App::Property", "Parametrization type"), + ) + obj.addProperty( + "App::PropertyVectorList", + "Tangents", + "General", + QT_TRANSLATE_NOOP("App::Property", "Tangents at interpolated points"), + ) + obj.addProperty( + "App::PropertyBoolList", + "TangentFlags", + "General", + QT_TRANSLATE_NOOP("App::Property", "Activation flag of tangents"), + ) + obj.addProperty( + "App::PropertyLinkSub", + "FaceSupport", + "Spiral", + QT_TRANSLATE_NOOP("App::Property", "Face support of the spiral"), + ) + obj.addProperty( + "App::PropertyInteger", + "UTurns", + "Spiral", + QT_TRANSLATE_NOOP("App::Property", "Nb of turns between 2 points, in U direction"), + ).UTurns = 0 + obj.addProperty( + "App::PropertyInteger", + "VTurns", + "Spiral", + QT_TRANSLATE_NOOP("App::Property", "Nb of turns between 2 points, in V direction"), + ).VTurns = 0 obj.Parametrization = ["ChordLength", "Centripetal", "Uniform", "Custom"] obj.Proxy = self if isinstance(source, (list, tuple)): @@ -290,10 +370,12 @@ def onDocumentRestored(self, fp): fp.setEditorMode("CustomTangents", 2) self.touch_parametrization(fp) if not hasattr(fp, "StartOffset"): - fp.addProperty("App::PropertyInteger", - "StartOffset", - "General", - "Offset the start index of the point list").StartOffset = 0 + fp.addProperty( + "App::PropertyInteger", + "StartOffset", + "General", + QT_TRANSLATE_NOOP("App::Property", "Offset the start index of the point list"), + ).StartOffset = 0 class ViewProviderInterpolate: diff --git a/freecad/Curves/isocurves.py b/freecad/Curves/isocurves.py index af9813c..1f46b2e 100644 --- a/freecad/Curves/isocurves.py +++ b/freecad/Curves/isocurves.py @@ -53,16 +53,16 @@ def __init__(self, face, direc='U', param=0): self.direction = 'U' self.parameter = 0 if not isinstance(face, Part.Face): - FreeCAD.Console.PrintMessage("Error. Not a face") + FreeCAD.Console.PrintMessage(translate("Log", "Error. Not a face")) else: self.bounds = face.ParameterRange self.face = face if direc not in 'UV': - FreeCAD.Console.PrintMessage("Direction error") + FreeCAD.Console.PrintMessage(translate("Log", "Direction error")) else: self.direction = direc if not isinstance(param, (float, int)): - FreeCAD.Console.PrintMessage("Parameter error") + FreeCAD.Console.PrintMessage(translate("Log", "Parameter error")) else: self.parameter = param @@ -105,7 +105,7 @@ def toShape(self): sortedPts = sorted(pts, key=lambda v: v.y) prange = [l2d.parameter(sortedPts[0]), l2d.parameter(sortedPts[-1])] else: - FreeCAD.Console.PrintMessage("No intersection points\n") + FreeCAD.Console.PrintMessage(translate("Log", "No intersection points\n")) elif self.direction == 'V': self.curve = self.face.Surface.vIso(self.parameter) v1 = Base.Vector2d(self.bounds[0] - ext, self.parameter) @@ -116,14 +116,14 @@ def toShape(self): sortedPts = sorted(pts, key=lambda v: v.x) prange = [l2d.parameter(sortedPts[0]), l2d.parameter(sortedPts[-1])] else: - FreeCAD.Console.PrintMessage("No intersection points\n") + FreeCAD.Console.PrintMessage(translate("Log", "No intersection points\n")) e = None if (prange[1] - prange[0]) > 1e-9: e = l2d.toShape(self.face, prange[0], prange[1]) if isinstance(e, Part.Edge): return e # else: - # FreeCAD.Console.PrintMessage("Failed to create isoCurve shape\n") + # FreeCAD.Console.PrintMessage(translate("Log", "Failed to create isoCurve shape\n")) # return None @@ -137,7 +137,7 @@ def __init__(self, face, numu=0, numv=0): self.uiso = [] self.viso = [] if not isinstance(face, Part.Face): - FreeCAD.Console.PrintMessage("Error. Not a face") + FreeCAD.Console.PrintMessage(translate("Log", "Error. Not a face")) else: self.bounds = face.ParameterRange self.face = face diff --git a/freecad/Curves/lineFP.py b/freecad/Curves/lineFP.py index eb680eb..a1dfd56 100644 --- a/freecad/Curves/lineFP.py +++ b/freecad/Curves/lineFP.py @@ -20,8 +20,8 @@ class line: """Creates a parametric line between two vertexes""" def __init__(self, obj): """Add the properties""" - obj.addProperty("App::PropertyLinkSub", "Vertex1", "Line", "First Vertex") - obj.addProperty("App::PropertyLinkSub", "Vertex2", "Line", "Second Vertex") + obj.addProperty("App::PropertyLinkSub", "Vertex1", "Line", QT_TRANSLATE_NOOP("App::Property", "First Vertex")) + obj.addProperty("App::PropertyLinkSub", "Vertex2", "Line", QT_TRANSLATE_NOOP("App::Property", "Second Vertex")) obj.Proxy = self def execute(self, obj): @@ -31,7 +31,7 @@ def execute(self, obj): ls = Part.LineSegment(v1.Point, v2.Point) obj.Shape = ls.toShape() else: - FreeCAD.Console.PrintError("{} broken !\n".format(obj.Label)) + FreeCAD.Console.PrintError(translate("Log", "{} broken !\n")).format(obj.Label) class lineVP: @@ -82,7 +82,7 @@ def Activated(self): if len(verts) == 2: self.makeLineFeature(verts) else: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) def IsActive(self): if FreeCAD.ActiveDocument: diff --git a/freecad/Curves/map_on_face.py b/freecad/Curves/map_on_face.py index 5a0841a..6c5b854 100644 --- a/freecad/Curves/map_on_face.py +++ b/freecad/Curves/map_on_face.py @@ -429,10 +429,10 @@ def get_pcurve(self, edge): if len(proj.Edges) == 0: raise RuntimeError("Failed to get pcurve") if len(proj.Edges) > 1: - FreeCAD.Console.PrintWarning("Projection: several pcurves") + FreeCAD.Console.PrintWarning(translate("Log", "Projection: several pcurves")) cos = self.quad.curveOnSurface(proj.Edge1) if edge.isClosed() and not cos[0].isClosed(): - FreeCAD.Console.PrintWarning("pcurve should be closed") + FreeCAD.Console.PrintWarning(translate("Log", "pcurve should be closed")) diff --git a/freecad/Curves/mixed_curve.py b/freecad/Curves/mixed_curve.py index cb90699..84e6e72 100644 --- a/freecad/Curves/mixed_curve.py +++ b/freecad/Curves/mixed_curve.py @@ -72,16 +72,52 @@ def shape(self): class MixedCurveFP: """Builds a 3D curve as the intersection of 2 projected curves.""" def __init__(self, obj, s1, s2, d1, d2): - obj.addProperty("App::PropertyLink", "Shape1", "Mixed Curve", "First shape").Shape1 = s1 - obj.addProperty("App::PropertyLink", "Shape2", "Mixed Curve", "Second shape").Shape2 = s2 - obj.addProperty("App::PropertyVector", "Direction1", "Mixed Curve", - "Projection direction of the first shape.\nIf vector is null, shape's placement is used.").Direction1 = d1 - obj.addProperty("App::PropertyVector", "Direction2", "Mixed Curve", - "Projection direction of the second shape.\nIf vector is null, shape's placement is used.").Direction2 = d2 - obj.addProperty("App::PropertyBool", "FillFace1", "Mixed Curve", - "Build ruled surfaces between Shape1 and resulting Mixed-Curve").FillFace1 = False - obj.addProperty("App::PropertyBool", "FillFace2", "Mixed Curve", - "Build ruled surfaces between Shape2 and resulting Mixed-Curve").FillFace2 = False + obj.addProperty( + "App::PropertyLink", + "Shape1", + "Mixed Curve", + QT_TRANSLATE_NOOP("App::Property", "First shape"), + ).Shape1 = s1 + obj.addProperty( + "App::PropertyLink", + "Shape2", + "Mixed Curve", + QT_TRANSLATE_NOOP("App::Property", "Second shape"), + ).Shape2 = s2 + obj.addProperty( + "App::PropertyVector", + "Direction1", + "Mixed Curve", + QT_TRANSLATE_NOOP( + "App::Property", + "Projection direction of the first shape.\nIf vector is null, shape's placement is used.", + ), + ).Direction1 = d1 + obj.addProperty( + "App::PropertyVector", + "Direction2", + "Mixed Curve", + QT_TRANSLATE_NOOP( + "App::Property", + "Projection direction of the second shape.\nIf vector is null, shape's placement is used.", + ), + ).Direction2 = d2 + obj.addProperty( + "App::PropertyBool", + "FillFace1", + "Mixed Curve", + QT_TRANSLATE_NOOP( + "App::Property", "Build ruled surfaces between Shape1 and resulting Mixed-Curve" + ), + ).FillFace1 = False + obj.addProperty( + "App::PropertyBool", + "FillFace2", + "Mixed Curve", + QT_TRANSLATE_NOOP( + "App::Property", "Build ruled surfaces between Shape2 and resulting Mixed-Curve" + ), + ).FillFace2 = False obj.Proxy = self def execute(self, obj): @@ -173,7 +209,7 @@ def Activated(self): except AttributeError: sel = FreeCADGui.Selection.getSelectionEx() if not len(sel) == 2: - FreeCAD.Console.PrintError("Select 2 objects !\n") + FreeCAD.Console.PrintError(translate("Log", "Select 2 objects !\n")) return for selobj in sel: selobj.Object.ViewObject.Visibility = False diff --git a/freecad/Curves/multiLoftFP.py b/freecad/Curves/multiLoftFP.py index 53b2826..a931d8a 100644 --- a/freecad/Curves/multiLoftFP.py +++ b/freecad/Curves/multiLoftFP.py @@ -1,12 +1,14 @@ # -*- coding: utf-8 -*- -__title__ = "MultiLoft" +import FreeCAD + +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" __doc__ = """Loft profile objects made of multiple faces in parallel""" import os -import FreeCAD import FreeCADGui import Part # from freecad.Curves import _utils @@ -21,10 +23,30 @@ class MultiLoftFP: """Creates a MultiLoft""" def __init__(self, obj): """Add the properties""" - obj.addProperty("App::PropertyLinkList", "Sources", "Multiloft", "Objects to loft") - obj.addProperty("App::PropertyBool", "Ruled", "Multiloft", "Ruled Loft").Ruled = False - obj.addProperty("App::PropertyBool", "Closed", "Multiloft", "Close loft").Closed = False - obj.addProperty("App::PropertyInteger", "MaxDegree", "Multiloft", "Max Bspline degree").MaxDegree = 5 + obj.addProperty( + "App::PropertyLinkList", + "Sources", + "Multiloft", + QT_TRANSLATE_NOOP("App::Property", "Objects to loft"), + ) + obj.addProperty( + "App::PropertyBool", + "Ruled", + "Multiloft", + QT_TRANSLATE_NOOP("App::Property", "Ruled Loft"), + ).Ruled = False + obj.addProperty( + "App::PropertyBool", + "Closed", + "Multiloft", + QT_TRANSLATE_NOOP("App::Property", "Close loft"), + ).Closed = False + obj.addProperty( + "App::PropertyInteger", + "MaxDegree", + "Multiloft", + QT_TRANSLATE_NOOP("App::Property", "Max Bspline degree"), + ).MaxDegree = 5 obj.Proxy = self def execute(self, obj): @@ -113,7 +135,7 @@ def makeFeature(self, sel): def Activated(self): sel = FreeCADGui.Selection.getSelection() if sel == []: - FreeCAD.Console.PrintError("Select something first !\n") + FreeCAD.Console.PrintError(translate("Log", "Select something first !\n")) else: self.makeFeature(sel) diff --git a/freecad/Curves/nurbs_surface_match.py b/freecad/Curves/nurbs_surface_match.py index e978bee..e39bf16 100644 --- a/freecad/Curves/nurbs_surface_match.py +++ b/freecad/Curves/nurbs_surface_match.py @@ -6,7 +6,7 @@ def debug(string): if DEBUG: FreeCAD.Console.PrintMessage(string) - FreeCAD.Console.PrintMessage("\n") + FreeCAD.Console.PrintMessage(translate("Log", "\n")) # ****** match degrees ****** @@ -34,7 +34,7 @@ def matchVDegree(s1,s2): def matchURange(s1,s2): '''make the UKnotSequence of surface s1 match the UKnotSequence of surface s2''' if not s1.UDegree == s2.UDegree: - FreeCAD.Console.PrintError("U degree mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "U degree mismatch error\n")) return(False) if s1.bounds()[0:2] == s2.bounds()[0:2]: debug("U parameter ranges already matching") @@ -53,7 +53,7 @@ def matchURange(s1,s2): def matchVRange(s1,s2): '''make the VKnotSequence of surface s1 match the VKnotSequence of surface s2''' if not s1.VDegree == s2.VDegree: - FreeCAD.Console.PrintError("V degree mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "V degree mismatch error\n")) return(False) if s1.bounds()[2::] == s2.bounds()[2::]: debug("V parameter ranges already matching") @@ -84,10 +84,10 @@ def getIndex(k,ks): def matchUknots(s1,s2,tol=0.000001): '''insert knots to make surfaces s1 and s2 have the same U knots sequences''' if not s1.UDegree == s2.UDegree: - FreeCAD.Console.PrintError("U degree mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "U degree mismatch error\n")) return(False) if not s1.bounds()[0:2] == s2.bounds()[0:2]: - FreeCAD.Console.PrintError("U parameter ranges mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "U parameter ranges mismatch error\n")) return(False) k1 = s1.getUKnots() k2 = s2.getUKnots() @@ -107,10 +107,10 @@ def matchUknots(s1,s2,tol=0.000001): def matchVknots(s1,s2,tol=0.000001): '''insert knots to make surfaces s1 and s2 have the same V knots sequences''' if not s1.VDegree == s2.VDegree: - FreeCAD.Console.PrintError("V degree mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "V degree mismatch error\n")) return(False) if not s1.bounds()[2::] == s2.bounds()[2::]: - FreeCAD.Console.PrintError("V parameter ranges mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "V parameter ranges mismatch error\n")) return(False) k1 = s1.getVKnots() k2 = s2.getVKnots() @@ -132,13 +132,13 @@ def matchVknots(s1,s2,tol=0.000001): def matchUMults(s1,s2): '''insert knots to make surfaces s1 and s2 have the same U knot multiplicities''' if not s1.UDegree == s2.UDegree: - FreeCAD.Console.PrintError("U degree mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "U degree mismatch error\n")) return(False) if not s1.bounds()[0:2] == s2.bounds()[0:2]: - FreeCAD.Console.PrintError("U parameter ranges mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "U parameter ranges mismatch error\n")) return(False) if not s1.getUKnots() == s2.getUKnots(): - FreeCAD.Console.PrintError("U KnotSequence mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "U KnotSequence mismatch error\n")) return(False) m1 = s1.getUMultiplicities() m2 = s2.getUMultiplicities() @@ -152,13 +152,13 @@ def matchUMults(s1,s2): def matchVMults(s1,s2): '''insert knots to make surfaces s1 and s2 have the same V knot multiplicities''' if not s1.VDegree == s2.VDegree: - FreeCAD.Console.PrintError("V degree mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "V degree mismatch error\n")) return(False) if not s1.bounds()[2::] == s2.bounds()[2::]: - FreeCAD.Console.PrintError("V parameter ranges mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "V parameter ranges mismatch error\n")) return(False) if not s1.getVKnots() == s2.getVKnots(): - FreeCAD.Console.PrintError("V KnotSequence mismatch error\n") + FreeCAD.Console.PrintError(translate("Log", "V KnotSequence mismatch error\n")) return(False) m1 = s1.getVMultiplicities() m2 = s2.getVMultiplicities() diff --git a/freecad/Curves/nurbs_tools.py b/freecad/Curves/nurbs_tools.py index bb20e83..fa8979e 100644 --- a/freecad/Curves/nurbs_tools.py +++ b/freecad/Curves/nurbs_tools.py @@ -765,7 +765,7 @@ def __init__(self, shape): path = shape.approximate(1e-8, 1e-3, 99, 5) # &tol2d, &tol3d, &maxseg, &maxdeg self.path = path.toShape() else: - FreeCAD.Console.PrintError("EdgeInterpolator input must be edge or wire") + FreeCAD.Console.PrintError(translate("Log", "EdgeInterpolator input must be edge or wire")) raise ValueError def add_data(self, p, dat): @@ -777,7 +777,7 @@ def add_data(self, p, dat): if isinstance(dat, type(self.data[0][1])): self.data.append((p, dat)) else: - FreeCAD.Console.PrintError("Bad type of data") + FreeCAD.Console.PrintError(translate("Log", "Bad type of data")) def add_mult_data(self, dat): """add multiple data values""" @@ -785,7 +785,7 @@ def add_mult_data(self, dat): for d in dat: self.add_data(d[0], d[1]) else: - FreeCAD.Console.PrintError("Argument must be list or tuple") + FreeCAD.Console.PrintError(translate("Log", "Argument must be list or tuple")) def get_point(self, val): v = FreeCAD.Vector(0, 0, 0) diff --git a/freecad/Curves/parametricSolid.py b/freecad/Curves/parametricSolid.py index eb069fa..3ae21b2 100644 --- a/freecad/Curves/parametricSolid.py +++ b/freecad/Curves/parametricSolid.py @@ -58,18 +58,27 @@ def get_svg(shape_type): class solid: """Make a parametric solid from selected faces""" def __init__(self, obj): - obj.addProperty("App::PropertyLinkSubList", - "Faces", - "Solid", - "List of faces to build the solid") - obj.addProperty("App::PropertyString", - "ShapeStatus", - "Solid", - "Status of the created shape") - obj.addProperty("App::PropertyBool", - "ShowOpenEdges", - "Debug", - "If the output shape in not a solid, this will output the open edges") + obj.addProperty( + "App::PropertyLinkSubList", + "Faces", + "Solid", + QT_TRANSLATE_NOOP("App::Property", "List of faces to build the solid"), + ) + obj.addProperty( + "App::PropertyString", + "ShapeStatus", + "Solid", + QT_TRANSLATE_NOOP("App::Property", "Status of the created shape"), + ) + obj.addProperty( + "App::PropertyBool", + "ShowOpenEdges", + "Debug", + QT_TRANSLATE_NOOP( + "App::Property", + "If the output shape in not a solid, this will output the open edges", + ), + ) obj.ShapeStatus = "" obj.setEditorMode("ShapeStatus", 1) obj.Proxy = self @@ -165,7 +174,7 @@ def Activated(self): faces = [] sel = FreeCADGui.Selection.getSelectionEx('', 0) if sel == []: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) for selobj in sel: if selobj.HasSubObjects: for i in range(len(selobj.SubObjects)): diff --git a/freecad/Curves/pasteSVG.py b/freecad/Curves/pasteSVG.py index 26228e0..5aec9aa 100644 --- a/freecad/Curves/pasteSVG.py +++ b/freecad/Curves/pasteSVG.py @@ -34,7 +34,7 @@ def Activated(self): doc.recompute() FreeCADGui.SendMsgToActiveView("ViewFit") else: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) def IsActive(self): cb = QtGui.QApplication.clipboard() diff --git a/freecad/Curves/pipeshellFP.py b/freecad/Curves/pipeshellFP.py index ac24417..21a77f9 100644 --- a/freecad/Curves/pipeshellFP.py +++ b/freecad/Curves/pipeshellFP.py @@ -15,36 +15,140 @@ TOOL_ICON = os.path.join(ICONPATH, 'pipeshell.svg') DEBUG = False +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + def debug(string): if DEBUG: FreeCAD.Console.PrintMessage(string) - FreeCAD.Console.PrintMessage("\n") + FreeCAD.Console.PrintMessage(translate("Log", "\n")) class pipeShell: "PipeShell featurePython object" def __init__(self, obj): - ''' Add the properties ''' - obj.addProperty("App::PropertyLinkSubList", "Spine", "Main", "Sweep path") - obj.addProperty("App::PropertyLinkList", "Profiles", "Main", "Profiles that are swept along spine") - obj.addProperty("App::PropertyLink", "Support", "Mode", "Shape of the ShapeSupport mode") - obj.addProperty("App::PropertyLink", "Auxiliary", "Mode", "Auxiliary spine") - obj.addProperty("App::PropertyEnumeration", "Mode", "Main", "PipeShell mode").Mode = ["Frenet", "DiscreteTrihedron", "FixedTrihedron", "Binormal", "ShapeSupport", "AuxiliarySpine"] - obj.addProperty("App::PropertyEnumeration", "Output", "Main", "Output shape").Output = ["Sections", "Lofted sections", "Surface"] - obj.addProperty("App::PropertyBool", "Solid", "Settings", "Make solid object").Solid = False - obj.addProperty("App::PropertyInteger", "MaxDegree", "Settings", "Maximum degree of the generated surface").MaxDegree = 5 - obj.addProperty("App::PropertyInteger", "MaxSegments", "Settings", "Maximum number of segments of the generated surface").MaxSegments = 999 - obj.addProperty("App::PropertyInteger", "Samples", "Settings", "Number of samples for preview").Samples = 100 - obj.addProperty("App::PropertyFloat", "Tol3d", "Settings", "Tolerance 3D").Tol3d = 1.0e-4 - obj.addProperty("App::PropertyFloat", "TolBound", "Settings", "Tolerance boundary").TolBound = 1.0e-4 - obj.addProperty("App::PropertyFloat", "TolAng", "Settings", "Tolerance angular").TolAng = 1.0e-2 - obj.addProperty("App::PropertyVector", "Direction", "Mode", "Direction of the Binormal and FixedTrihedron modes") - obj.addProperty("App::PropertyVector", "Location", "Mode", "Location of the FixedTrihedron mode") - obj.addProperty("App::PropertyBool", "Corrected", "Mode", "Corrected Frenet").Corrected = False - obj.addProperty("App::PropertyBool", "EquiCurvi", "Mode", "Curvilinear equivalence").EquiCurvi = False - obj.addProperty("App::PropertyEnumeration", "Contact", "Mode", "Type of contact to auxiliary spine").Contact = ["NoContact", "Contact", "ContactOnBorder"] + """Add the properties""" + obj.addProperty( + "App::PropertyLinkSubList", + "Spine", + "Main", + QT_TRANSLATE_NOOP("App::Property", "Sweep path"), + ) + obj.addProperty( + "App::PropertyLinkList", + "Profiles", + "Main", + QT_TRANSLATE_NOOP("App::Property", "Profiles that are swept along spine"), + ) + obj.addProperty( + "App::PropertyLink", + "Support", + "Mode", + QT_TRANSLATE_NOOP("App::Property", "Shape of the ShapeSupport mode"), + ) + obj.addProperty( + "App::PropertyLink", + "Auxiliary", + "Mode", + QT_TRANSLATE_NOOP("App::Property", "Auxiliary spine"), + ) + obj.addProperty( + "App::PropertyEnumeration", + "Mode", + "Main", + QT_TRANSLATE_NOOP("App::Property", "PipeShell mode"), + ).Mode = [ + "Frenet", + "DiscreteTrihedron", + "FixedTrihedron", + "Binormal", + "ShapeSupport", + "AuxiliarySpine", + ] + obj.addProperty( + "App::PropertyEnumeration", + "Output", + "Main", + QT_TRANSLATE_NOOP("App::Property", "Output shape"), + ).Output = ["Sections", "Lofted sections", "Surface"] + obj.addProperty( + "App::PropertyBool", + "Solid", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Make solid object"), + ).Solid = False + obj.addProperty( + "App::PropertyInteger", + "MaxDegree", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Maximum degree of the generated surface"), + ).MaxDegree = 5 + obj.addProperty( + "App::PropertyInteger", + "MaxSegments", + "Settings", + QT_TRANSLATE_NOOP( + "App::Property", "Maximum number of segments of the generated surface" + ), + ).MaxSegments = 999 + obj.addProperty( + "App::PropertyInteger", + "Samples", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Number of samples for preview"), + ).Samples = 100 + obj.addProperty( + "App::PropertyFloat", + "Tol3d", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Tolerance 3D"), + ).Tol3d = 1.0e-4 + obj.addProperty( + "App::PropertyFloat", + "TolBound", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Tolerance boundary"), + ).TolBound = 1.0e-4 + obj.addProperty( + "App::PropertyFloat", + "TolAng", + "Settings", + QT_TRANSLATE_NOOP("App::Property", "Tolerance angular"), + ).TolAng = 1.0e-2 + obj.addProperty( + "App::PropertyVector", + "Direction", + "Mode", + QT_TRANSLATE_NOOP( + "App::Property", "Direction of the Binormal and FixedTrihedron modes" + ), + ) + obj.addProperty( + "App::PropertyVector", + "Location", + "Mode", + QT_TRANSLATE_NOOP("App::Property", "Location of the FixedTrihedron mode"), + ) + obj.addProperty( + "App::PropertyBool", + "Corrected", + "Mode", + QT_TRANSLATE_NOOP("App::Property", "Corrected Frenet"), + ).Corrected = False + obj.addProperty( + "App::PropertyBool", + "EquiCurvi", + "Mode", + QT_TRANSLATE_NOOP("App::Property", "Curvilinear equivalence"), + ).EquiCurvi = False + obj.addProperty( + "App::PropertyEnumeration", + "Contact", + "Mode", + QT_TRANSLATE_NOOP("App::Property", "Type of contact to auxiliary spine"), + ).Contact = ["NoContact", "Contact", "ContactOnBorder"] obj.Mode = "DiscreteTrihedron" obj.Contact = "NoContact" obj.Output = "Sections" @@ -166,7 +270,11 @@ def onChanged(self, fp, prop): fp.TolAng = 1000 if prop == "Contact": if fp.Contact == "ContactOnBorder": - FreeCAD.Console.PrintError("\nSorry, ContactOnBorder option is currently broken in OCCT.\n") + FreeCAD.Console.PrintError( + translate( + "Log", "\nSorry, ContactOnBorder option is currently broken in OCCT.\n" + ) + ) fp.Contact = "Contact" def add(self, ps, p): @@ -209,11 +317,15 @@ def execute(self, obj): if not direction: direction = FreeCAD.Vector(0, 0, 1) obj.Direction = direction - FreeCAD.Console.PrintError("\nWrong direction, defaulting to +Z\n") + FreeCAD.Console.PrintError( + translate("Log", "\nWrong direction, defaulting to +Z\n") + ) elif direction.Length < 1e-7: direction = FreeCAD.Vector(0, 0, 1) obj.Direction = direction - FreeCAD.Console.PrintError("\nDirection has null length, defaulting to +Z\n") + FreeCAD.Console.PrintError( + translate("Log", "\nDirection has null length, defaulting to +Z\n") + ) if mode == "Binormal": debug("Binormal mode (%r)" % direction) ps.setBiNormalMode(direction) @@ -240,7 +352,9 @@ def execute(self, obj): debug("AuxiliarySpine mode (%r %s)" % (curv, cont)) ps.setAuxiliarySpine(w, curv, n) else: - FreeCAD.Console.PrintError("\nPlease set a valid Auxiliary Spine Object\n") + FreeCAD.Console.PrintError( + translate("Log", "\nPlease set a valid Auxiliary Spine Object\n") + ) elif mode == "ShapeSupport": sup = self.getprop(obj, "Support") sh = None @@ -250,7 +364,7 @@ def execute(self, obj): debug("ShapeSupport mode") ps.setSpineSupport(sh) else: - FreeCAD.Console.PrintError("\nPlease set a valid Spine support Object\n") + FreeCAD.Console.PrintError(translate("Log", "\nPlease set a valid Spine support Object\n")) for p in profs: self.add(ps, p) @@ -272,7 +386,7 @@ def execute(self, obj): c = Part.Compound(shapes + rails) obj.Shape = c else: - FreeCAD.Console.PrintError("\nFailed to create shape\n") + FreeCAD.Console.PrintError(translate("Log", "\nFailed to create shape\n")) def getCode(self, cont): if cont == "Contact": @@ -373,7 +487,12 @@ def Activated(self): # path.ViewObject.LineColor = (1.0,0.3,0.0) self.makePipeShellFeature(path, profs) else: - FreeCAD.Console.PrintError("\nYou must select:\n- in the 3D view, the edges that build the sweep path\n- in the Tree view, one or more 'pipeshellProfile' objects\n") + FreeCAD.Console.PrintError( + translate( + "Log", + "\nYou must select:\n- in the 3D view, the edges that build the sweep path\n- in the Tree view, one or more 'pipeshellProfile' objects\n", + ) + ) def IsActive(self): if FreeCAD.ActiveDocument: diff --git a/freecad/Curves/pipeshellProfileFP.py b/freecad/Curves/pipeshellProfileFP.py index 73292b9..127a9a2 100644 --- a/freecad/Curves/pipeshellProfileFP.py +++ b/freecad/Curves/pipeshellProfileFP.py @@ -15,23 +15,53 @@ TOOL_ICON = os.path.join( ICONPATH, 'profile.svg') DEBUG = False +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + + def debug(string): if DEBUG: FreeCAD.Console.PrintMessage(string) FreeCAD.Console.PrintMessage("\n") + class profile: "Profile object for PipeShell" def __init__(self, obj, source): - ''' Add the properties ''' - if isinstance(source,(list,tuple)): - obj.addProperty("App::PropertyLinkSubList", "Profile", "Profile", "SubShapes of the profile") + """Add the properties""" + if isinstance(source, (list, tuple)): + obj.addProperty( + "App::PropertyLinkSubList", + "Profile", + "Profile", + QT_TRANSLATE_NOOP("App::Property", "SubShapes of the profile"), + ) else: - obj.addProperty("App::PropertyLink", "Profile", "Profile", "source object of the profile") + obj.addProperty( + "App::PropertyLink", + "Profile", + "Profile", + QT_TRANSLATE_NOOP("App::Property", "source object of the profile"), + ) obj.Profile = source - obj.addProperty("App::PropertyLinkSub", "Location", "Profile", "Vertex location on spine") - obj.addProperty("App::PropertyBool", "Contact", "Profile", "Translate profile to contact spine").Contact = False - obj.addProperty("App::PropertyBool", "Correction", "Profile", "Rotate profile to be orthogonal to spine").Correction = False + obj.addProperty( + "App::PropertyLinkSub", + "Location", + "Profile", + QT_TRANSLATE_NOOP("App::Property", "Vertex location on spine"), + ) + obj.addProperty( + "App::PropertyBool", + "Contact", + "Profile", + QT_TRANSLATE_NOOP("App::Property", "Translate profile to contact spine"), + ).Contact = False + obj.addProperty( + "App::PropertyBool", + "Correction", + "Profile", + QT_TRANSLATE_NOOP("App::Property", "Rotate profile to be orthogonal to spine"), + ).Correction = False obj.Proxy = self def getEdgeList(self, obj, prop): @@ -81,9 +111,9 @@ def execute(self, obj): if w: obj.Shape = w else: - FreeCAD.Console.PrintError("\nFailed to build wire\n") + FreeCAD.Console.PrintError(translate("Log", "\nFailed to build wire\n")) else: - FreeCAD.Console.PrintError("\nFailed to extract edges\n") + FreeCAD.Console.PrintError(translate("Log", "\nFailed to extract edges\n")) class profileVP: def __init__(self,vobj): @@ -144,7 +174,7 @@ def Activated(self): source = None sel = FreeCADGui.Selection.getSelectionEx() if sel == []: - FreeCAD.Console.PrintError("Select at least 1 edge !\n") + FreeCAD.Console.PrintError(translate("Log", "Select at least 1 edge !\n")) for selobj in sel: if selobj.HasSubObjects: for i in range(len(selobj.SubObjects)): diff --git a/freecad/Curves/profile_editor.py b/freecad/Curves/profile_editor.py index 7accf83..83ee93a 100644 --- a/freecad/Curves/profile_editor.py +++ b/freecad/Curves/profile_editor.py @@ -5,7 +5,7 @@ from freecad.Curves import _utils from freecad.Curves import graphics # from graphics import COLORS -# FreeCAD.Console.PrintMessage("Using local Pivy.graphics library\n") +# FreeCAD.Console.PrintMessage(translate("Log", "Using local Pivy.graphics library\n")) def parameterization(points, a, closed): @@ -240,7 +240,7 @@ def __init__(self, points=[], fp=None): elif isinstance(p, (MarkerOnShape, ConnectionMarker)): self.points.append(p) else: - FreeCAD.Console.PrintError("InterpoCurveEditor : bad input") + FreeCAD.Console.PrintError(translate("Log", "InterpoCurveEditor : bad input")) # Setup coin objects if self.fp: self.guidoc = self.fp.ViewObject.Document @@ -363,7 +363,7 @@ def controlCB(self, attr, event_callback): for i in range(len(self.root.selected_objects)): if isinstance(self.root.selected_objects[i], MarkerOnShape): self.root.selected_objects[i].sublink = tup - FreeCAD.Console.PrintMessage("Snapped to {}\n".format(str(self.root.selected_objects[i].sublink))) + FreeCAD.Console.PrintMessage(translate("Log", "Snapped to {}\n")).format(str(self.root.selected_objects[i].sublink)) self.root.selected_objects[i].drag_start() self.root.selected_objects[i].drag((0, 0, 0.)) self.root.selected_objects[i].drag_release() @@ -371,7 +371,7 @@ def controlCB(self, attr, event_callback): elif event.getKey() == ord("l"): self.toggle_linear() elif (event.getKey() == 65535) or (event.getKey() == 65288): # Suppr or Backspace - # FreeCAD.Console.PrintMessage("Some objects have been deleted\n") + # FreeCAD.Console.PrintMessage(translate("Log", "Some objects have been deleted\n")) pts = list() for o in self.root.dynamic_objects: if isinstance(o, MarkerOnShape): @@ -433,9 +433,9 @@ def set_planar(self): pl = Part.Plane(p0, p1, p1 + view_dir) for o in markers: if isinstance(o.snap_shape, Part.Vertex): - FreeCAD.Console.PrintMessage("Snapped to Vertex\n") + FreeCAD.Console.PrintMessage(translate("Log", "Snapped to Vertex\n")) elif isinstance(o.snap_shape, Part.Edge): - FreeCAD.Console.PrintMessage("Snapped to Edge\n") + FreeCAD.Console.PrintMessage(translate("Log", "Snapped to Edge\n")) c = o.snap_shape.Curve pts = pl.intersect(c)[0] new_pts = list() @@ -451,7 +451,7 @@ def set_planar(self): new_pts.append(new) o.points = new_pts elif isinstance(o.snap_shape, Part.Face): - FreeCAD.Console.PrintMessage("Snapped to Face\n") + FreeCAD.Console.PrintMessage(translate("Log", "Snapped to Face\n")) s = o.snap_shape.Surface cvs = pl.intersect(s) new_pts = list() @@ -468,7 +468,7 @@ def set_planar(self): new_pts.append(new) o.points = new_pts else: - FreeCAD.Console.PrintMessage("Not snapped\n") + FreeCAD.Console.PrintMessage(translate("Log", "Not snapped\n")) new_pts = list() for ip in o.points: iv = FreeCAD.Vector(ip[0], ip[1], ip[2]) @@ -489,7 +489,7 @@ def subdivide(self): pts.append(o.markers[0]) if o in self.root.selected_objects: idx = self.lines.index(o) - FreeCAD.Console.PrintMessage("Subdividing line #{}\n".format(idx)) + FreeCAD.Console.PrintMessage(translate("Log", "Subdividing line #{}\n")).format(idx) p1 = o.markers[0].points[0] p2 = o.markers[1].points[0] par1 = self.curve.parameter(FreeCAD.Vector(p1)) diff --git a/freecad/Curves/property_editor.py b/freecad/Curves/property_editor.py index 6c18048..eb9ca09 100644 --- a/freecad/Curves/property_editor.py +++ b/freecad/Curves/property_editor.py @@ -69,7 +69,7 @@ def add_layout(self,name): self.widget.layout.addLayout(g) return(g) else: - FreeCAD.Console.PrintError("VPEditor has no widget !\n") + FreeCAD.Console.PrintError(translate("Log", "VPEditor has no widget !\n")) def add_propeditor(self,editor,group): """add a property editor widget""" group.addWidget(editor) @@ -105,14 +105,14 @@ def reject(self): self.quit() @Slot() def quit(self): - FreeCAD.Console.PrintMessage("VPEditor.Quit() \n") + FreeCAD.Console.PrintMessage(translate("Log", "VPEditor.Quit() \n")) self.widget.close() try: self.comboview.removeTab(self.tabIndex) self.comboview.setCurrentIndex(0) FreeCADGui.ActiveDocument.resetEdit() except: - FreeCAD.Console.PrintError("Failed to remove from ComboView\n") + FreeCAD.Console.PrintError(translate("Log", "Failed to remove from ComboView\n")) class VectorListWidget(QTableWidget): def __init__(self, fp=None, prop=None, parent=None): diff --git a/freecad/Curves/segmentSurfaceFP.py b/freecad/Curves/segmentSurfaceFP.py index 91747bb..df9daad 100644 --- a/freecad/Curves/segmentSurfaceFP.py +++ b/freecad/Curves/segmentSurfaceFP.py @@ -27,15 +27,68 @@ class SegmentSurface: def __init__(self, obj, face): """Add the properties""" - obj.addProperty("App::PropertyLinkSub", "Source", "Base", "Initial Face").Source = face - obj.addProperty("App::PropertyEnumeration", "Option", "Base", "Option list").Option = ["Auto", "Custom"] - obj.addProperty("App::PropertyEnumeration", "Direction", "OptionAuto", "Segmenting direction").Direction = ["U", "V", "Both"] - obj.addProperty("App::PropertyFloatList", "KnotsU", "UDirection", "Splitting parameters in U direction") - obj.addProperty("App::PropertyFloatList", "KnotsV", "VDirection", "Splitting parameters in V direction") - obj.addProperty("App::PropertyInteger", "NumberU", "UDirection", "Split the U parameter range in the given number of segments").NumberU = 2 - obj.addProperty("App::PropertyInteger", "NumberV", "VDirection", "Split the V parameter range in the given number of segments").NumberV = 2 - obj.addProperty("App::PropertyLink", "KnotsUProvider", "UDirection", "Object generating normalized parameters in U direction") - obj.addProperty("App::PropertyLink", "KnotsVProvider", "VDirection", "Object generating normalized parameters in V direction") + obj.addProperty( + "App::PropertyLinkSub", + "Source", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Initial Face"), + ).Source = face + obj.addProperty( + "App::PropertyEnumeration", + "Option", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Option list"), + ).Option = ["Auto", "Custom"] + obj.addProperty( + "App::PropertyEnumeration", + "Direction", + "OptionAuto", + QT_TRANSLATE_NOOP("App::Property", "Segmenting direction"), + ).Direction = ["U", "V", "Both"] + obj.addProperty( + "App::PropertyFloatList", + "KnotsU", + "UDirection", + QT_TRANSLATE_NOOP("App::Property", "Splitting parameters in U direction"), + ) + obj.addProperty( + "App::PropertyFloatList", + "KnotsV", + "VDirection", + QT_TRANSLATE_NOOP("App::Property", "Splitting parameters in V direction"), + ) + obj.addProperty( + "App::PropertyInteger", + "NumberU", + "UDirection", + QT_TRANSLATE_NOOP( + "App::Property", "Split the U parameter range in the given number of segments" + ), + ).NumberU = 2 + obj.addProperty( + "App::PropertyInteger", + "NumberV", + "VDirection", + QT_TRANSLATE_NOOP( + "App::Property", "Split the V parameter range in the given number of segments" + ), + ).NumberV = 2 + obj.addProperty( + "App::PropertyLink", + "KnotsUProvider", + "UDirection", + QT_TRANSLATE_NOOP( + "App::Property", "Object generating normalized parameters in U direction" + ), + ) + obj.addProperty( + "App::PropertyLink", + "KnotsVProvider", + "VDirection", + QT_TRANSLATE_NOOP( + "App::Property", "Object generating normalized parameters in V direction" + ), + ) obj.Proxy = self obj.Option = "Custom" @@ -203,7 +256,7 @@ def makeFeature(self, s): def Activated(self): sel = FreeCADGui.Selection.getSelectionEx() if sel == []: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) else: self.makeFeature(sel[0]) diff --git a/freecad/Curves/splitCurves_2.py b/freecad/Curves/splitCurves_2.py index 2cc29d7..98ece84 100644 --- a/freecad/Curves/splitCurves_2.py +++ b/freecad/Curves/splitCurves_2.py @@ -34,38 +34,60 @@ class split: """Splits the selected edge.""" def __init__(self, obj, e): obj.Proxy = self - obj.addProperty("App::PropertyLinkSub", - "Source", - "Base", - "Edge to split").Source = e - obj.addProperty("App::PropertyStringList", - "Values", - "Split", - "List of splitting locations\n% and units are allowed\nNegative values are computed from edge end") - obj.addProperty("App::PropertyInteger", - "Number", - "Split", - "Number of equal segments").Number = 2 - obj.addProperty("App::PropertyLinkList", - "CuttingObjects", - "Split", - "List of objects that cut the curve") - obj.addProperty("App::PropertyBool", - "CutAtVertexes", - "Split", - "Create a split point at nearest of each vertex of the cutting objects") - obj.addProperty("App::PropertyDistance", - "Distance", - "Split", - "Expression-ready distance value") - obj.addProperty("App::PropertyFloatList", - "NormalizedParameters", - "Output", - "Normalized parameters list") - obj.addProperty("App::PropertyBool", - "KeepSolid", - "Split", - "Rebuild and output the complete shape") + obj.addProperty( + "App::PropertyLinkSub", + "Source", + "Base", + QT_TRANSLATE_NOOP("App::Property", "Edge to split"), + ).Source = e + obj.addProperty( + "App::PropertyStringList", + "Values", + "Split", + QT_TRANSLATE_NOOP( + "App::Property", + "List of splitting locations\n% and units are allowed\nNegative values are computed from edge end", + ), + ) + obj.addProperty( + "App::PropertyInteger", + "Number", + "Split", + QT_TRANSLATE_NOOP("App::Property", "Number of equal segments"), + ).Number = 2 + obj.addProperty( + "App::PropertyLinkList", + "CuttingObjects", + "Split", + QT_TRANSLATE_NOOP("App::Property", "List of objects that cut the curve"), + ) + obj.addProperty( + "App::PropertyBool", + "CutAtVertexes", + "Split", + QT_TRANSLATE_NOOP( + "App::Property", + "Create a split point at nearest of each vertex of the cutting objects", + ), + ) + obj.addProperty( + "App::PropertyDistance", + "Distance", + "Split", + QT_TRANSLATE_NOOP("App::Property", "Expression-ready distance value"), + ) + obj.addProperty( + "App::PropertyFloatList", + "NormalizedParameters", + "Output", + QT_TRANSLATE_NOOP("App::Property", "Normalized parameters list"), + ) + obj.addProperty( + "App::PropertyBool", + "KeepSolid", + "Split", + QT_TRANSLATE_NOOP("App::Property", "Rebuild and output the complete shape"), + ) obj.setEditorMode("NormalizedParameters", 2) def getShape(self, fp): @@ -83,7 +105,7 @@ def getShape(self, fp): e = fp.Source[0].Shape.Edge1 w = None else: - FreeCAD.Console.PrintError("SplitCurve : Input shape has no wires or edges\n") + FreeCAD.Console.PrintError(translate("Log", "SplitCurve : Input shape has no wires or edges\n")) return None, None else: e = _utils.getShape(fp, "Source", "Edge") @@ -193,7 +215,7 @@ def execute(self, obj): # print([e.Length for e in edges]) se = Part.sortEdges(edges) if len(se) > 1: - FreeCAD.Console.PrintError("Split curve : failed to build temp Wire !") + FreeCAD.Console.PrintError(translate("Log", "Split curve : failed to build temp Wire !")) # print(se) w = Part.Wire(se[0]) else: @@ -207,7 +229,7 @@ def execute(self, obj): # # se = Part.sortEdges(edges) # if len(se) > 1: - # FreeCAD.Console.PrintError("Split curve : failed to build final Wire !") + # FreeCAD.Console.PrintError(translate("Log", "Split curve : failed to build final Wire !")) # wires = [] # for el in se: # wires.append(Part.Wire(el)) @@ -249,7 +271,7 @@ def execute(self, obj): obj.Shape = w obj.NormalizedParameters = KnotVector(params).normalize() else: - FreeCAD.Console.PrintError("Split curve : Invalid Wire !") + FreeCAD.Console.PrintError(translate("Log", "Split curve : Invalid Wire !")) obj.Shape = e @@ -423,7 +445,7 @@ def __init__(self, points=[], fp=None): elif isinstance(p, MarkerOnEdge): self.points.append(p) else: - FreeCAD.Console.PrintError("pointEditor : bad input") + FreeCAD.Console.PrintError(translate("Log", "pointEditor : bad input")) for p in points: if hasattr(p, "ctrl_keys"): for key in p.ctrl_keys: @@ -663,7 +685,7 @@ def makeSplitFeature(self, e): def Activated(self): sel = FreeCADGui.Selection.getSelectionEx() if sel == []: - FreeCAD.Console.PrintError("{} :\n{}\n".format(__title__, __usage__)) + FreeCAD.Console.PrintError(translate("Log", "{} :\n{}\n")).format(__title__, __usage__) for selobj in sel: if selobj.HasSubObjects: for i in range(len(selobj.SubObjects)): diff --git a/freecad/Curves/sublink_edit.py b/freecad/Curves/sublink_edit.py index 98ca345..5c4fd71 100644 --- a/freecad/Curves/sublink_edit.py +++ b/freecad/Curves/sublink_edit.py @@ -161,13 +161,13 @@ def set_link(self): subs = list() sel = FreeCADGui.Selection.getSelectionEx() if sel == []: - FreeCAD.Console.PrintError("Nothing selected !\n") + FreeCAD.Console.PrintError(translate("Log", "Nothing selected !\n")) for selobj in sel: if selobj.HasSubObjects: subs.append(("(FreeCAD.ActiveDocument.getObject('%s'),%s)" % (selobj.Object.Name, selobj.SubElementNames))) if self.obj.getTypeIdOfProperty(self.link) == 'App::PropertyLinkSub': if not len(subs) == 1: - FreeCAD.Console.PrintError("This property accept only 1 subobject !\n") + FreeCAD.Console.PrintError(translate("Log", "This property accept only 1 subobject !\n")) else: # FreeCADGui.doCommand("subobj = FreeCAD.ActiveDocument.getObject('%s')"%(subs[0][0].Name)) FreeCADGui.doCommand("FreeCAD.ActiveDocument.getObject('%s').%s = %s" % (self.obj.Name, self.link, subs[0])) @@ -224,7 +224,7 @@ class sle: def Activated(self): s = FreeCADGui.Selection.getSelection() if not len(s) == 1: - FreeCAD.Console.PrintError("Select 1 object !\n") + FreeCAD.Console.PrintError(translate("Log", "Select 1 object !\n")) else: hasSubLink = False for p in s[0].PropertiesList: @@ -255,10 +255,10 @@ def GetResources(self): class proxy(object): """Feature python proxy""" def __init__(self, obj): - obj.addProperty("App::PropertyLinkSubList", "Profile", "Profile", "SubShapes of the profile") - obj.addProperty("App::PropertyLinkSub", "Location1", "Profile", "Vertex location on spine") - obj.addProperty("App::PropertyLinkSub", "Location2", "Profile", "Vertex location on spine") - obj.addProperty("App::PropertyLinkSub", "Location3", "Profile", "Vertex location on spine") + obj.addProperty("App::PropertyLinkSubList", "Profile", "Profile", QT_TRANSLATE_NOOP("App::Property", "SubShapes of the profile")) + obj.addProperty("App::PropertyLinkSub", "Location1", "Profile", QT_TRANSLATE_NOOP("App::Property", "Vertex location on spine")) + obj.addProperty("App::PropertyLinkSub", "Location2", "Profile", QT_TRANSLATE_NOOP("App::Property", "Vertex location on spine")) + obj.addProperty("App::PropertyLinkSub", "Location3", "Profile", QT_TRANSLATE_NOOP("App::Property", "Vertex location on spine")) obj.Proxy = self From 85f3e2a42e105013c40a4211deb55765e5694cfc Mon Sep 17 00:00:00 2001 From: hasecilu Date: Tue, 15 Oct 2024 13:37:17 -0600 Subject: [PATCH 3/7] Add script to update strings marked for translation Include agnostic file --- .../Curves/resources/translations/Curves.ts | 3163 +++++++++++++++++ .../translations/update_translation.sh | 168 + 2 files changed, 3331 insertions(+) create mode 100644 freecad/Curves/resources/translations/Curves.ts create mode 100755 freecad/Curves/resources/translations/update_translation.sh diff --git a/freecad/Curves/resources/translations/Curves.ts b/freecad/Curves/resources/translations/Curves.ts new file mode 100644 index 0000000..af23d6b --- /dev/null +++ b/freecad/Curves/resources/translations/Curves.ts @@ -0,0 +1,3163 @@ + + + + + App::Property + + + + Edge + + + + + Tool target + + + + + Discretization Method + + + + + Number of edge points + + + + + Distance between edge points + + + + + Distance for deflection Algorithm + + + + + Angular value for Angular-Curvature Algorithm + + + + + Curvature value for Angular-Curvature Algorithm + + + + + Minimum Number of points + + + + + Start parameter + + + + + End parameter + + + + + + + Points + + + + + + Normalized parameters list + + + + + Object on which the analysis is performed + + + + + Anaysis direction + + + + + Positive draft angle + + + + + Negative draft angle + + + + + Positive draft tolerance + + + + + Negative draft tolerance + + + + + Color of the positive in-draft area + + + + + Color of the positive tolerance area + + + + + Color of the positive out-of-draft area + + + + + Color of the negative in-draft area + + + + + Color of the negative tolerance area + + + + + Color of the negative out-of-draft area + + + + + + Amount of shading on the analysis overlay + + + + + + + Input face + + + + + Size of the map in the U direction + + + + + Size of the map in the V direction + + + + + Add the bounding box of the face + + + + + The conical face to flatten + + + + + Unroll the face in place + + + + + Size of the underlying surface + + + + + SourceObjects + + + + + SourceShapes + + + + + Number of orthogonal samples + + + + + Smoothing factor on curve start + + + + + Smoothing factor on curve end + + + + + Projection method (1,2,3,4) + + + + + + 3D tolerance + + + + + + Parametric tolerance + + + + + + Number of turns + + + + + Thread lead (-1 for auto) + + + + + Allow rational bsplines + + + + + Create a solid shape + + + + + IsoCurve parameter + + + + + Number of IsoCurve in U direction + + + + + Number of IsoCurve in V direction + + + + + Number of IsoCurve + + + + + Curve Orientation + + + + + List of edges to join + + + + + Join all the edges of this base object + + + + + + + Tolerance + + + + + Break on sharp corners + + + + + Force connection of edges + + + + + Force closed curve + + + + + Reverse the output curve + + + + + Set the start point of closed curve + + + + + + Source object + + + + + Direction Vector + + + + + Number of samples around object + + + + + Edge 1 + + + + + Edge 2 + + + + + Location on first edge + + + + + + Reverse Edge + + + + + + + + Scale of blend curve + + + + + + + + Continuity + + + + + Location on second edge + + + + + Poles of the Bezier curve + + + + + + + Output type + + + + + Compute scales to get minimal curvature along curve + + + + + Scale (%). 0 for AutoScale + + + + + + + Number of samples + + + + + Number of surface samples + + + + + Surface Comb Orientation + + + + + CombPoints + + + + + Shape of comb plot + + + + + Color of the curvature curve + + + + + Color of the curvature comb + + + + + List of constraint objects + + + + + Plate degree + + + + + Number of iterations + + + + + 2D Tolerance + + + + + 3D Tolerance + + + + + Angular Tolerance + + + + + Curvature Tolerance + + + + + Anisotropie + + + + + Max degree of Bspline approximation + + + + + Max Number of surface segments + + + + + Max Distance to plate surface + + + + + 3D Tolerance of Bspline approximation + + + + + Criterion Order + + + + + Desired continuity of the surface + + + + + Enlarge Coefficient + + + + + First support edge + + + + + Second support edge + + + + + Parameter on first edge + + + + + Parameter on second edge + + + + + Main axis of the sketch + + + + + + + + + + + + + + + + + + + Tooltip + + + + + Individual faces + + + + + View position + + + + + View direction + + + + + Up direction + + + + + Remove duplicate edges + + + + + Number of edge samples + + + + + CleaningTolerance for duplicate detection + + + + + Isoparametric lines + + + + + Outline silhouette lines + + + + + smooth edge of G1-continuity between two surfaces + + + + + sewn edge of CN-continuity on one surface + + + + + sharp edge (of C0-continuity) + + + + + Generate the visible lines, or the hidden lines + + + + + Output on-shape 3D lines + + + + + Track camera movements + + + + + The list of profiles to sweep + + + + + The sweep path + + + + + Face support of the sweep path + + + + + Trim the sweep shape + + + + + Add profiles to the sweep shape + + + + + Number of extra profiles + + + + + Build a smooth top with extra profiles + + + + + Input Sketch + + + + + Additional objects that will be mapped on surface + + + + + Make faces from closed wires + + + + + Add extrusion faces + + + + + Offset distance of mapped sketch + + + + + Extrusion thickness + + + + + Reverse U direction + + + + + Reverse V direction + + + + + Swap U and V directions + + + + + include construction geometry in sketch bounds + + + + + Analysis Direction + + + + + Analysis Mode + + + + + Fix analysis direction to global coordinate system + + + + + Number of stripes (Zebra, Rainbow) + + + + + Relative width of stripes (Zebra) + + + + + First color (Zebra, Rainbow, Isophote) + + + + + Second color (Zebra, Rainbow, Isophote) + + + + + Start angle of the rainbow + + + + + End angle of the rainbow + + + + + Angles of isophote curves + + + + + Angular tolerance of isophote curves + + + + + Birail object + + + + + List of profiles + + + + + Blending method + + + + + Parametrization of interpolating curves + + + + + + + Profile Samples + + + + + Extend to rail limits + + + + + Shape + + + + + Picked point in parametric space of the face (u,v,0) + + + + + Trimming curve + + + + + Trimming Vector + + + + + Trimming direction + + + + + The object that will be truncated or extended + + + + + The planar object that cuts the Source object + + + + + The distance to truncate (if negative) or extend (if positive) + + + + + Refine shape (clean up redundant edges) + + + + + Reverse cutter plane normal + + + + + Object containing the points to approximate + + + + + Clamp endpoints + + + + + Force a closed curve + + + + + + Minimum degree of the curve + + + + + + Maximum degree of the curve + + + + + + Approximation tolerance + + + + + + Desired continuity of the curve + + + + + Approximation method + + + + + + + Parametrization type + + + + + Weight of curve length for smoothing algorithm + + + + + Weight of curve curvature for smoothing algorithm + + + + + Weight of curve torsion for smoothing algorithm + + + + + Index of first point + + + + + Index of last point (-1 to ignore) + + + + + For closed curves, allows to choose the location of the join point + + + + + Use approximation + + + + + Proxy object of the approximation extension + + + + + Faces to join + + + + + Number of samples to generate each surface + + + + + Fuse the 3 solids together + + + + + Continuity order G... with shape 1 + + + + + Continuity order G... with shape 2 + + + + + + Compute scales to get regular poles, or minimal curvature + + + + + + Number of samples for auto scaling + + + + + Scale values along face 1 + + + + + Scale values along face 2 + + + + + + Status of the created shape + + + + + First edge + + + + + Second edge + + + + + + Placement + + + + + Edge Samples + + + + + Untwist surface + + + + + Variable scale 1: list of vectors(parameter, scale1, 0) + + + + + Variable scale 2: list of vectors(parameter, scale2, 0) + + + + + Edges and support faces + + + + + Number of samples to generate surface + + + + + Continuity level with face of edge 1 + + + + + Continuity level with face of edge 2 + + + + + Scale values along edge 1 + + + + + Scale values along edge 2 + + + + + Spring Length + + + + + Diameter of the spring wire + + + + + Diameter of the spring + + + + + Flatness of spring extremities from 0 to 4 + + + + + Output a wire shape + + + + + Left hand if true + + + + + The list of seam edges to check + + + + + Number of test samples on edge + + + + + Number of test lines on each sample + + + + + Continuity tolerance + + + + + Input edge to extend + + + + + + Output shape + + + + + Start Extension Length + + + + + Start Extension type + + + + + End Extension Length + + + + + End Extension type + + + + + Input edge + + + + + Support face + + + + + Reverse tangent + + + + + Reverse normal + + + + + Reverse binormal + + + + + Width of the output face + + + + + Face symmetric across curve + + + + + Close the curve + + + + + Reverse the parametric orientation of the curve + + + + + Curve network + + + + + Max Number of control points + + + + + Number of samples in U direction + + + + + Number of samples in V direction + + + + + Flip surface normal + + + + + Constraint shapes + + + + + Parametrization factor + + + + + Periodic curve + + + + + Data list + + + + + Tangents list + + + + + Tangent flags + + + + + Types of interpolated points + + + + + Linear segment flags + + + + + Size of a grid quadrant + + + + + Size of subdivisions + + + + + XY plane attenuation + + + + + XZ plane attenuation + + + + + YZ plane attenuation + + + + + XY plane max visibility + + + + + XZ plane max visibility + + + + + YZ plane max visibility + + + + + Grid Color + + + + + Source object that provides points to interpolate + + + + + Point list to interpolate + + + + + Set the curve closed + + + + + Interpolation tolerance + + + + + User specified tangents + + + + + interpolate 3 aligned points with a line + + + + + interpolate with a degree 1 polygonal curve + + + + + + Offset the start index of the point list + + + + + outputs a wire or a single edge + + + + + Parameters of interpolated points + + + + + Tangents at interpolated points + + + + + Activation flag of tangents + + + + + Face support of the spiral + + + + + Nb of turns between 2 points, in U direction + + + + + Nb of turns between 2 points, in V direction + + + + + First Vertex + + + + + Second Vertex + + + + + First shape + + + + + Second shape + + + + + Projection direction of the first shape. +If vector is null, shape's placement is used. + + + + + Projection direction of the second shape. +If vector is null, shape's placement is used. + + + + + Build ruled surfaces between Shape1 and resulting Mixed-Curve + + + + + Build ruled surfaces between Shape2 and resulting Mixed-Curve + + + + + Objects to loft + + + + + Ruled Loft + + + + + Close loft + + + + + Max Bspline degree + + + + + List of faces to build the solid + + + + + If the output shape in not a solid, this will output the open edges + + + + + Sweep path + + + + + Profiles that are swept along spine + + + + + Shape of the ShapeSupport mode + + + + + Auxiliary spine + + + + + PipeShell mode + + + + + Make solid object + + + + + Maximum degree of the generated surface + + + + + Maximum number of segments of the generated surface + + + + + Number of samples for preview + + + + + Tolerance 3D + + + + + Tolerance boundary + + + + + Tolerance angular + + + + + Direction of the Binormal and FixedTrihedron modes + + + + + Location of the FixedTrihedron mode + + + + + Corrected Frenet + + + + + Curvilinear equivalence + + + + + Type of contact to auxiliary spine + + + + + + SubShapes of the profile + + + + + source object of the profile + + + + + + + + Vertex location on spine + + + + + Translate profile to contact spine + + + + + Rotate profile to be orthogonal to spine + + + + + Initial Face + + + + + Option list + + + + + Segmenting direction + + + + + Splitting parameters in U direction + + + + + Splitting parameters in V direction + + + + + Split the U parameter range in the given number of segments + + + + + Split the V parameter range in the given number of segments + + + + + Object generating normalized parameters in U direction + + + + + Object generating normalized parameters in V direction + + + + + Edge to split + + + + + List of splitting locations +% and units are allowed +Negative values are computed from edge end + + + + + Number of equal segments + + + + + List of objects that cut the curve + + + + + Create a split point at nearest of each vertex of the cutting objects + + + + + Expression-ready distance value + + + + + Rebuild and output the complete shape + + + + + CurveEditor + + + Curve Editor + + + + + Curve Type : + + + + + Bezier + + + + + Degree + + + + + OK + + + + + Cancel + + + + + Curves_AdjacentFaces + + + Select Adjacent faces + + + + + Select the Adjacent faces of the selected subshape + + + + + Select a face or an edge in the 3D View, activate tool +and all the faces that touch it will be added to the selection. + + + + + Usage + + + + + Curves_Approximate + + + Approximate + + + + + Approximate points to NURBS curve or surface + + + + + Curves_BlendSolid + + + BlendSolid + + + + + Create a solid between two faces with some continuity with their support shapes + + + + + Select a face on each of the two solids to blend, in the 3D View. + + + + + Usage + + + + + Curves_BlendSurf2 + + + BlendSurface + + + + + Create a surface between two edges with some continuity with their support faces + + + + + You must select 4 subshapes in the 3D View : +- EDGE1 on FACE1 +- EDGE2 on FACE2 + + + + + Usage + + + + + Curves_BsplineToConsole + + + Creates a python script to build the selected BSpline or Bezier geometries. + + + + + Select some Bezier or BSpline curves or surfaces in the 3D View and activate the tool. +The selected curves or surfaces will be re-created with commands in the python console. + + + + + BSpline to Console + + + + + Usage + + + + + Curves_CompressionSpring + + + Compression Spring + + + + + Parametric Compression Spring + + + + + Curves_CurveOnSurface + + + CurveOnSurface + + + + + Create a curve on surface object + + + + + Curves_Discretize + + + Discretize + + + + + Discretize an edge or a wire. + + + + + Select an edge in the 3D View +Activate tool +It will generate some points along the edge, following various methods + + + + + Usage + + + + + Curves_DraftAnalysis + + + Draft Analysis + + + + + Create a colored overlay on an object to visualize draft angles. +Tool options are in the View tab. +Mouse clics in the colored areas print measured draft angle in the Report View. + + + + + Curves_EditableSpline + + + Freehand BSpline + + + + + Creates an freehand BSpline curve + + + + + *** Interpolation curve control keys : + + a - Select all / Deselect + i - Insert point in selected segments + t - Set / unset tangent (view direction) + p - Align selected objects + s - Snap points on shape / Unsnap + l - Set/unset a linear interpolation + x,y,z - Axis constraints during grab + q - Apply changes and quit editing + + + + + Usage + + + + + Curves_ExtendCurve + + + Curve extend + + + + + Extend an edge by a given distance. + + + + + Select an edge in the 3D View, and activate tool. +Edge can be extended at each end, by a given distance. + + + + + Usage + + + + + Curves_ExtractSubshape + + + Extract subshape + + + + + Make a non-parametric copy of selected subshapes. +Same as Part_ElementCopy + + + + + Curves_FlattenFace + + + Flatten face + + + + + Creates a flat developed face from conical and cylindrical faces + + + + + You must select a conical or cylindrical face in the 3D View. +InPlace property puts the unrolled face tangent to the source face (InPlace = True) +or in the XY plane (InPlace = False) + + + + + Usage + + + + + Curves_GeometryInfo + + + GeomInfo + + + + + Display geometry information about selected shape + + + + + While active, this tool displays information about the geometry of an edge or face. +It displays poles, knots and weights of Bezier and BSpline curves and surfaces in the 3D View. + + + + + Curves_GordonSurface + + + Parametric Gordon surface + + + + + Creates a surface that skins a network of curves. + + + + + Curves_Interpolate + + + Interpolate + + + + + Interpolate a set of points. + + + + + Curves_IsoCurve + + + IsoCurve + + + + + IsoCurve: Create an IsoCurve from a face + + + + + Curves_JoinCurve + + + joinCurves + + + + + Joins the selected edges into a BSpline Curve + + + + + Select the edges to join in the 3D View, or select an object containing multiple edges in the Tree View. +Activate the tool. +The output is a single BSpline curve joining all selected edges. + + + + + Usage + + + + + Curves_Line + + + Parametric line + + + + + Parametric line between two vertexes. + + + + + Select 2 vertexes in the 3D View and activate the tool. + + + + + Usage + + + + + Curves_MixedCurve + + + Mixed curve + + + + + Builds a 3D curve as the intersection of 2 projected curves. + + + + + Select two objects or shapes, and activate tool. +The camera direction is saved during each shape selection, and will be used as projection direction. +Set these directions to (0,0,0) to use the placement of each shape as projection direction. + + + + + Usage + + + + + Curves_MultiLoft + + + MultiLoft + + + + + Loft profile objects made of multiple faces in parallel + + + + + Curves_ObjectsToConsole + + + Objects to Console + + + + + Give access to the selected objects in the python console. + + + + + Select some objects in the TreeView, or in the 3D View, and activate tool. +Some variables will be created in the python console, to access the selection. + + + + + Usage + + + + + Curves_ParametricBlendCurve + + + Blend curve + + + + + Blend curve between two edges. Double-clic object to enable/disable freehand mouse editing. + + + + + Curves_ParametricComb + + + Comb plot + + + + + Creates a parametric Comb plot on selected edges + + + + + Curves_ParametricSolid + + + Parametric solid + + + + + Make a parametric solid from selected faces. + + + + + Select some faces in the 3D View, or select objects in the Tree View. +Activate tool. +It will try to build a solid from selected faces. +If not possible, it falls back to a shell, then to a compound. +The ShapeStatus property (and the color of the icon) give the type of shape. + + + + + Usage + + + + + Curves_PasteSVG + + + Paste SVG + + + + + Paste the SVG content of the clipboard + + + + + When working in parallel with FreeCAD and a SVG editor (Inkscape), +copy (CTRL-C) an object in the SVG editor, switch to FreeCAD and activate tool. +This will import the SVG content of the clipboard into the active FreeCAD document. + + + + + Usage + + + + + Curves_Pipeshell + + + Pipeshell + + + + + Creates a PipeShell sweep object + + + + + Curves_PipeshellProfile + + + Pipeshell profile + + + + + Creates a Profile object for PipeShell + + + + + Curves_ProfileSupport + + + Profile Support + + + + + Creates a support shape between two rails + + + + + Curves_ProfileSupportPlane + + + Profile support plane + + + + + Creates a support plane for sketches + + + + + Curves_ReflectLines + + + Reflect Lines + + + + + Creates the reflect lines on a shape, according to a view direction + + + + + Select an object and activate tool. +This will create reflect lines according to the current view direction. +If selected object is a ReflectLines object, the view direction will be updated to the current camera direction. +If property OnShape is True, the lines will be ON the input shape (ViewPos and UpDir properties won't be used). +Otherwise, lines will be on the XY plane. +If view property TrackCam is True, the view direction will keep updating upon camera movements. + + + + + + Usage + + + + + Curves_RotationSweep + + + Rotation Sweep + + + + + Sweep some profiles along a path, and around a point + + + + + Select a sweep path and some profiles in the 3D View. +If TrimPath is False, the Sweep surface will be extrapolated to fit the whole path. + + + + + Usage + + + + + Curves_SegmentSurface + + + Segment surface + + + + + Segment a surface on isocurves + + + + + Select a face in the 3D view and activate tool. +The face will be converted to a BSpline surface. +In Auto mode, the surface will be segmented along isocurves of highest multiplicity. +In Custom mode, it will be segmented along isocurves of specified parameters. +These parameters can be provided by an external object that have a NormalizedParameters property, +like the Discretize, or the SplitCurve tools. + + + + + Usage + + + + + Curves_SketchOnSurface + + + Sketch on surface + + + + + Map a sketch on a surface + + + + + Curves_SplitCurve + + + Split curve + + + + + Splits the selected edge + + + + + Select an edge in the 3D View, or an object containing a wire in the Tree View +Activate Tool +The selected edges (or wire) will be cut at the specified location. +The split locations can be given as real edge parameter, absolute distance(mm) or relative distance (%) +The split locations can be set by proximity to cutting objects. +Double-click in Tree-View to toggle Freehand editor in 3D View. + + + + + + Usage + + + + + Curves_SurfaceAnalysis + + + Surface Analysis + + + + + Doc + + + + + Curves_SweepToRails + + + Sweep2Rails + + + + + Sweep profiles on 2 rails + + + + + Curves_Trim + + + Trim face + + + + + Trim a face with a projected curve + + + + + Curves_TruncateExtendCmd + + + Truncate Extend + + + + + Cut a shape with a plane and truncate or extend it by a given distance. +In a PartDesign body, select only the cutting plane. +Otherwise, select the shape to modify, and the cutting plane. + + + + + Curves_ZebraTool + + + ZebraTool + + + + + Zebra texture for surface inspection + + + + + Log + + + + + +BSplineCurve + + + + + + + Degree: {} + + + + + + + NbPoles: {} + + + + + + + Knots: {} ({:0.2f} - {:0.2f}) + + + + + + + Mults: {} + + + + + + + Periodic: {} + + + + + + + + +BSplineSurface +************ + + + + + + + + + Failed to compute uIso curve + + + + + + + + + Failed to compute vIso curve + + + + + + + + ************ + + + + + + + + {} + + + + + + + + + + Error in onDelete: {0} + + + + + + + + + + + + + + + + + {} : +{} + + + + + + InterpolationPolygon : bad input + + + + + + + + + + Select something first ! + + + + + + Bad input :{}-{} + + + + + + + + + + + + + + + + + + BlendCurve: Install 'scipy' python package for AutoScale feature + + + + + + + pointEditor : bad input + + + + + --- Entering Comb Edit Mode --- + + + + + + Nb of samples : CTRL + Mouse Up / Down + + + + + + Comb scale : SHIFT + Mouse Up / Down + + + + + + --- Exiting Comb Edit Mode --- + + + + + + Periodic interpolation + + + + + + Ignoring duplicate last point + + + + + + Duplicates point list + + + + + + Parameters are not increasing + + + + + + Falling back to ChordLength + + + + + + + Select 2 edges or vertexes first ! + + + + + + Select 2 rail objects, and optionally some profile objects + + + + + + Select an object first ! + + + + + + Sketch on surface : failed to create solid # {}. + + + + + + Please select a face (in the 3D view) or a sketch + + + + + + Select a ruled surface and a list of profile edges + + + + + + Select 2 rails and at least 2 profiles + + + + + + Failed importing BOPTools. Fallback to Part API + + + + + + Wrong Selection + + + + + + Zebra already active + + + + + + CurvesWB._utils.getShape: wrong property type. + + + + + + +Please select an object that has at least 2 vertexes + + + + + BlendSolid : The two faces must have the same number of edges + + + + + + BlendSurface : failed to compute scale +{} + + + + + + Select 2 CurveOnSurface objects. + + + + + + + + failed to extract 2D geometry + + + + + Segmenting input curve + + + + + + Select the edges to extend first ! + + + + + + Curve_on_surface.get_cross_curve : parameter out of range + + + + + + {} is not in [{},{}] + + + + + + {} - {} + + + + + + + Select an edge and its supporting face + + + + + + --- + + + + + + + + exchange UV + + + + + + reverse U + + + + + + reverse V + + + + + + Inserting flat profile at 0.0 + + + + + + Inserting flat profile at 1.0 + + + + + + Select a curve network ! + + + + + + Gordon Profile : Data and DataType mismatch + + + + + + execute is disabled during editing + + + + + + {} : Not enough points + + + + + + + Error. Not a face + + + + + Direction error + + + + + Parameter error + + + + + + No intersection points + + + + + + {} broken ! + + + + + + Projection: several pcurves + + + + + pcurve should be closed + + + + + Select 2 objects ! + + + + + + + + U degree mismatch error + + + + + + + + V degree mismatch error + + + + + + + U parameter ranges mismatch error + + + + + + + V parameter ranges mismatch error + + + + + + U KnotSequence mismatch error + + + + + + V KnotSequence mismatch error + + + + + + EdgeInterpolator input must be edge or wire + + + + + Bad type of data + + + + + Argument must be list or tuple + + + + + +Sorry, ContactOnBorder option is currently broken in OCCT. + + + + + + +Wrong direction, defaulting to +Z + + + + + + +Direction has null length, defaulting to +Z + + + + + + +Please set a valid Auxiliary Spine Object + + + + + + +Please set a valid Spine support Object + + + + + + +Failed to create shape + + + + + + +You must select: +- in the 3D view, the edges that build the sweep path +- in the Tree view, one or more 'pipeshellProfile' objects + + + + + + +Failed to build wire + + + + + + +Failed to extract edges + + + + + + Select at least 1 edge ! + + + + + + InterpoCurveEditor : bad input + + + + + Snapped to {} + + + + + + Snapped to Vertex + + + + + + Snapped to Edge + + + + + + Snapped to Face + + + + + + Not snapped + + + + + + Subdividing line #{} + + + + + + VPEditor has no widget ! + + + + + + VPEditor.Quit() + + + + + + Failed to remove from ComboView + + + + + + SplitCurve : Input shape has no wires or edges + + + + + + Split curve : failed to build temp Wire ! + + + + + Split curve : Invalid Wire ! + + + + + Nothing selected ! + + + + + + This property accept only 1 subobject ! + + + + + + Select 1 object ! + + + + + + Workbench + + + + + + + Curves + + + + + a workbench dedicated to curves and surfaces + + + + + + Surfaces + + + + + + Misc. + + + + + Zebra + + + Zebra Stripes Tool + + + + + Black Stripes Width + + + + + Scale + + + + + Rotation + + + + + Quit + + + + diff --git a/freecad/Curves/resources/translations/update_translation.sh b/freecad/Curves/resources/translations/update_translation.sh new file mode 100755 index 0000000..cc23dc3 --- /dev/null +++ b/freecad/Curves/resources/translations/update_translation.sh @@ -0,0 +1,168 @@ +#!/usr/bin/env bash + +# -------------------------------------------------------------------------------------------------- +# +# Create, update and release translation files. +# +# Supported locales on FreeCAD <2024-12-08, FreeCADGui.supportedLocales(), total=44>: +# {'English': 'en', 'Afrikaans': 'af', 'Arabic': 'ar', 'Basque': 'eu', 'Belarusian': 'be', +# 'Bulgarian': 'bg', 'Catalan': 'ca', 'Chinese Simplified': 'zh-CN', +# 'Chinese Traditional': 'zh-TW', 'Croatian': 'hr', 'Czech': 'cs', 'Danish': 'da', +# 'Dutch': 'nl', 'Filipino': 'fil', 'Finnish': 'fi', 'French': 'fr', 'Galician': 'gl', +# 'Georgian': 'ka', 'German': 'de', 'Greek': 'el', 'Hungarian': 'hu', 'Indonesian': 'id', +# 'Italian': 'it', 'Japanese': 'ja', 'Kabyle': 'kab', 'Korean': 'ko', 'Lithuanian': 'lt', +# 'Norwegian': 'no', 'Polish': 'pl', 'Portuguese': 'pt-PT', 'Portuguese, Brazilian': 'pt-BR', +# 'Romanian': 'ro', 'Russian': 'ru', 'Serbian': 'sr', 'Serbian, Latin': 'sr-CS', 'Slovak': 'sk', +# 'Slovenian': 'sl', 'Spanish': 'es-ES', 'Spanish, Argentina': 'es-AR', 'Swedish': 'sv-SE', +# 'Turkish': 'tr', 'Ukrainian': 'uk', 'Valencian': 'val-ES', 'Vietnamese': 'vi'} +# +# NOTE: PREPARATION +# - Install Qt tools +# Debian-based (e.g., Ubuntu): $ sudo apt-get install qttools5-dev-tools pyqt6-dev-tools +# Fedora-based: $ sudo dnf install qt6-linguist qt6-devel +# Arch-based: $ sudo pacman -S qt6-tools python-pyqt6 +# - Make the script executable +# $ chmod +x update_translation.sh +# - The script has to be executed within the `freecad/Curves/resources/translations` directory. +# Executing the script with no flags invokes the help. +# $ ./update_translation.sh +# +# NOTE: WORKFLOW TRANSLATOR (LOCAL) +# - Execute the script passing the `-u` flag plus locale code as argument +# Only update the file(s) you're translating! +# $ ./update_translation.sh -u es-ES +# - Do the translation via Qt Linguist and use `File>Release` +# - If releasing with the script execute it passing the `-r` flag +# plus locale code as argument +# $ ./update_translation.sh -r es-ES +# +# NOTE: WORKFLOW MAINTAINER (CROWDIN) +# - Execute the script passing the '-U' flag +# $ ./update_translation.sh -U +# - Once done, download the translated files, copy them to `freecad/Curves/resources/translations` +# - Upload the updated file to CrowdIn and wait for translators do their thing ;-) +# and release all the files to update the changes +# $ ./update_translation.sh -R +# +# -------------------------------------------------------------------------------------------------- + +supported_locales=( + "en" "af" "ar" "eu" "be" "bg" "ca" "zh-CN" "zh-TW" "hr" + "cs" "da" "nl" "fil" "fi" "fr" "gl" "ka" "de" "el" + "hu" "id" "it" "ja" "kab" "ko" "lt" "no" "pl" "pt-PT" + "pt-BR" "ro" "ru" "sr" "sr-CS" "sk" "sl" "es-ES" "es-AR" "sv-SE" + "tr" "uk" "val-ES" "vi" +) + +is_locale_supported() { + local locale="$1" + for supported_locale in "${supported_locales[@]}"; do + [ "$supported_locale" == "$locale" ] && return 0 + done + return 1 +} + +update_locale() { + local locale="$1" + local u=${locale:+_} # Conditional underscore + FILES="../../*.py ../../Blending/*.py \ + ../../DraftAnalysis_shaders/*.py \ + ../../Gui/*.ui" + + # NOTE: Execute the right command depending on: + # - if it's a locale file or the main, agnostic one + [ ! -f "${WB}${u}${locale}.ts" ] && action="Creating" || action="Updating" + echo -e "\033[1;34m\n\t<<< ${action} '${WB}${u}${locale}.ts' file >>>\n\033[m" + if [ "$u" == "" ]; then + eval $LUPDATE "$FILES" -ts "${WB}.ts" # locale-agnostic file + else + eval $LUPDATE "$FILES" -source-language en_US -target-language "${locale//-/_}" \ + -ts "${WB}_${locale}.ts" + fi +} + +normalize_crowdin_files() { + # Rename files which locales are different on FreeCAD and delete not supported locales + crowdin_fixes=(af-ZA ar-SA be-BY bg-BG ca-ES cs-CZ da-DK de-DE el-GR eu-ES fi-FI + fil-PH fr-FR gl-ES hr-HR hu-HU it-IT ja-JP ka-GE kab-KAB ko-KR lt-LT nl-NL + no-NO pl-PL ro-RO ru-RU sk-SK sl-SI sr-SP tr-TR uk-UA vi-VN) + + crowdin_deletes=(az-AZ bn-BD br-FR bs-BA en en-GB en-US eo-UY es-CO es-VE et-EE fa-IR he-IL + hi-IN hy-AM id-ID kaa lv-LV mk-MK ms-MY sat-IN si-LK ta-IN te-IN th-TH ur-PK xav yo-NG) + + for pattern in "${crowdin_fixes[@]}"; do + find . -type f -name "*_${pattern}\.*" | while read -r file; do + mv -v "$file" "${file//-*./.}" + done + done + + for pattern in "${crowdin_deletes[@]}"; do + find . -type f -name "*_${pattern}\.*" -delete + done +} + +help() { + echo -e "\nDescription:" + echo -e "\tCreate, update and release translation files." + echo -e "\nUsage:" + echo -e "\t./update_translation.sh [-R] [-U] [-r ] [-u ]" + echo -e "\nFlags:" + echo -e " -R\n\tRelease all translations (qm files)" + echo -e " -U\n\tUpdate all translations (ts files)" + echo -e " -r \n\tRelease the specified locale" + echo -e " -u \n\tUpdate strings for the specified locale" + echo -e " -N\n\tNormalize CrowdIn filenames" +} + +# Main function ------------------------------------------------------------------------------------ + +LUPDATE=/usr/lib/qt6/bin/lupdate # from Qt6 +# LUPDATE=lupdate # from Qt5 +LRELEASE=/usr/lib/qt6/bin/lrelease # from Qt6 +# LRELEASE=lrelease # from Qt5 +WB="Curves" + +sed -i '3s/-/_/' ${WB}*.ts # Enforce underscore on locales +sed -i '3s/\"en\"/\"en_US\"/g' ${WB}*.ts # Use en_US + +if [ $# -eq 1 ]; then + if [ "$1" == "-R" ]; then + find . -type f -name '*_*.ts' | while IFS= read -r file; do + # Release all locales + $LRELEASE -nounfinished "$file" + echo + done + elif [ "$1" == "-U" ]; then + for locale in "${supported_locales[@]}"; do + update_locale "$locale" + done + elif [ "$1" == "-u" ]; then + update_locale # Update main file (agnostic) + elif [ "$1" == "-N" ]; then + normalize_crowdin_files + else + help + fi +elif [ $# -eq 2 ]; then + LOCALE="$2" + if is_locale_supported "$LOCALE"; then + if [ "$1" == "-r" ]; then + # Release locale (creation of *.qm file from *.ts file) + $LRELEASE -nounfinished "${WB}_${LOCALE}.ts" + elif [ "$1" == "-u" ]; then + # Update main & locale files + update_locale + update_locale "$LOCALE" + fi + else + echo "Verify your language code. Case sensitive." + echo "If it's correct, ask a maintainer to add support for your language on FreeCAD." + echo -e "\nSupported locales, '\033[1;34mFreeCADGui.supportedLocales()\033[m': \033[1;33m" + for locale in $(printf "%s\n" "${supported_locales[@]}" | sort); do + echo -n "$locale " + done + echo + fi +else + help +fi From 3e184ef0e8481299a9a6ff9ae0dc12fb9b8649c7 Mon Sep 17 00:00:00 2001 From: hasecilu Date: Tue, 15 Oct 2024 13:39:55 -0600 Subject: [PATCH 4/7] Add `translations/README.md` file --- .../Curves/resources/translations/README.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 freecad/Curves/resources/translations/README.md diff --git a/freecad/Curves/resources/translations/README.md b/freecad/Curves/resources/translations/README.md new file mode 100644 index 0000000..1012bfe --- /dev/null +++ b/freecad/Curves/resources/translations/README.md @@ -0,0 +1,116 @@ +# About translating Curves Workbench + + +- [About translating Curves Workbench](#about-translating-curves-workbench) + - [Updating translations template file](#updating-translations-template-file) + - [Creating file for missing locale](#creating-file-for-missing-locale) + - [Using script](#using-script) + - [Renaming file](#renaming-file) + - [Translating](#translating) + - [Compiling translations](#compiling-translations) + - [Sending translations](#sending-translations) + - [More information](#more-information) + + +> [!NOTE] +> All commands **must** be run in `./freecad/Curves/resources/translations/` directory. + +> [!IMPORTANT] +> If you want to update/release the files you need to have installed +> `lupdate` and `lrelease` from Qt6 version. Using the versions from +> Qt5 is not advised because they're buggy. + +## Updating translations template file + +To update the template file from source files you should use this command: + +```shell +./update_translation.sh -U +``` + +Once done you can commit the changes and upload the new file to CrowdIn platform +at webpage and find the **Curves** project. + +## Creating file for missing locale + +### Using script + +To create a file for a new language with all **Curves** translatable strings execute +the script with `-u` flag plus your locale: + +```shell +./update_translation.sh -u fr +``` + +### Renaming file + +Also you can rename new `Curves.ts` file by appending the locale code, +for example, `Curves_fr.ts` for French and change + +```xml + +``` + +to + +```xml + +``` + +As of 15/10/2024 the supported locales on FreeCAD +(according to `FreeCADGui.supportedLocales()`) are 44: + +```python +{'English': 'en', 'Afrikaans': 'af', 'Arabic': 'ar', 'Basque': 'eu', +'Belarusian': 'be', 'Bulgarian': 'bg', 'Catalan': 'ca', +'Chinese Simplified': 'zh-CN', 'Chinese Traditional': 'zh-TW', 'Croatian': 'hr', +'Czech': 'cs', 'Danish': 'da', 'Dutch': 'nl', 'Filipino': 'fil', 'Finnish': 'fi', + 'French': 'fr', 'Galician': 'gl', 'Georgian': 'ka', 'German': 'de', 'Greek': 'el', + 'Hungarian': 'hu', 'Indonesian': 'id', 'Italian': 'it', 'Japanese': 'ja', + 'Kabyle': 'kab', 'Korean': 'ko', 'Lithuanian': 'lt', 'Norwegian': 'no', + 'Polish': 'pl', 'Portuguese': 'pt-PT', 'Portuguese, Brazilian': 'pt-BR', + 'Romanian': 'ro', 'Russian': 'ru', 'Serbian': 'sr', 'Serbian, Latin': 'sr-CS', + 'Slovak': 'sk', 'Slovenian': 'sl', 'Spanish': 'es-ES', 'Spanish, Argentina': 'es-AR', +'Swedish': 'sv-SE', 'Turkish': 'tr', 'Ukrainian': 'uk', 'Valencian': 'val-ES', +'Vietnamese': 'vi'} +``` + +## Translating + +To edit your language file open your file in `Qt Linguist` from `qt5-tools`/`qt6-tools` +package or in a text editor like `xed`, `mousepad`, `gedit`, `nano`, `vim`/`nvim`, +`geany` etc. and translate it. + +Alternatively you can visit the **FreeCAD-addons** project on CrowdIn platform +at webpage and find your language, +once done, look for the **Curves** project. + +## Compiling translations + +To convert all `.ts` files to `.qm` files (merge) you can use this command: + +```shell +./update_translation.sh -R +``` + +If you are a translator that wants to update only their language file +to test it on **FreeCAD** before doing a PR you can use this command: + +```shell +./update_translation.sh -r fr +``` + +This will update the `.qm` file for your language (French in this case). + +## Sending translations + +Now you can contribute your translated `.ts` file to **Curves** repository, +also include the `.qm` file. + + + +## More information + +You can read more about translating external workbenches here: + + From 3af241c20273b22ff8b7310ce45e6909fd883cdc Mon Sep 17 00:00:00 2001 From: hasecilu Date: Tue, 15 Oct 2024 13:40:47 -0600 Subject: [PATCH 5/7] Add `*.FCBak` files to `.gitignore` --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1a9c830..b9df375 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.pyc *.md *.fcstd1 +*.FCBak /docFiles/ From 4eea66e8ec68558614f795f99a49860530263f04 Mon Sep 17 00:00:00 2001 From: hasecilu Date: Tue, 15 Oct 2024 19:06:47 -0600 Subject: [PATCH 6/7] Mark commands' MenuText and ToolTip for translation --- freecad/Curves/Discretize.py | 29 +++++++++++++----- freecad/Curves/DraftAnalysisFP.py | 18 +++++++---- freecad/Curves/ExtractShapes.py | 26 +++++++++++----- freecad/Curves/FlattenFP.py | 41 ++++++++++++++++++-------- freecad/Curves/GeomInfo.py | 17 +++++++---- freecad/Curves/IsoCurve.py | 12 +++++--- freecad/Curves/JoinCurves.py | 27 ++++++++++++----- freecad/Curves/ParametricBlendCurve.py | 13 ++++++-- freecad/Curves/ParametricComb.py | 12 ++++++-- freecad/Curves/ProfileSketch.py | 3 +- freecad/Curves/ProfileSupportFP.py | 13 ++++---- freecad/Curves/ReflectLinesFP.py | 30 ++++++++++++++----- freecad/Curves/RotationSweepFP.py | 32 ++++++++++++++------ freecad/Curves/Sketch_On_Surface.py | 9 ++++-- freecad/Curves/SurfaceAnalysisFP.py | 15 ++++++---- freecad/Curves/Sweep2Rails.py | 8 +++-- freecad/Curves/TrimFace.py | 14 +++++---- freecad/Curves/Truncate_Extend_FP.py | 18 +++++++---- freecad/Curves/ZebraTool.py | 14 ++++++--- freecad/Curves/adjacent_faces.py | 26 +++++++++++----- freecad/Curves/approximate.py | 10 +++++-- freecad/Curves/blendSolidFP.py | 28 ++++++++++++++---- freecad/Curves/blendSurfaceFP_new.py | 31 ++++++++++++++----- freecad/Curves/comp_spring.py | 5 ++-- freecad/Curves/curveExtendFP.py | 22 ++++++++++---- freecad/Curves/curveOnSurfaceFP.py | 15 +++++++--- freecad/Curves/curve_to_script.py | 31 ++++++++++++++----- freecad/Curves/gordonFP.py | 12 ++++---- freecad/Curves/gordon_profile_FP.py | 28 +++++++++++++----- freecad/Curves/interpolate.py | 10 +++++-- freecad/Curves/lineFP.py | 22 ++++++++++---- freecad/Curves/mixed_curve.py | 30 ++++++++++++++----- freecad/Curves/multiLoftFP.py | 5 +++- freecad/Curves/parametricSolid.py | 29 +++++++++++++----- freecad/Curves/pasteSVG.py | 26 +++++++++++----- freecad/Curves/pipeshellFP.py | 13 ++++---- freecad/Curves/pipeshellProfileFP.py | 13 ++++---- freecad/Curves/segmentSurfaceFP.py | 29 +++++++++++++----- freecad/Curves/splitCurves_2.py | 29 +++++++++++++----- freecad/Curves/toConsole.py | 37 ++++++++++++++++------- 40 files changed, 570 insertions(+), 232 deletions(-) diff --git a/freecad/Curves/Discretize.py b/freecad/Curves/Discretize.py index 04e8e9f..d7a6a79 100644 --- a/freecad/Curves/Discretize.py +++ b/freecad/Curves/Discretize.py @@ -1,15 +1,22 @@ # -*- coding: utf-8 -*- -__title__ = "Discretize" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_Discretize", "Discretize") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Discretize an edge or a wire." -__usage__ = """Select an edge in the 3D View +__doc__ = translate("Curves_Discretize", "Discretize an edge or a wire.") +__usage__ = translate( + "Curves_Discretize", + """Select an edge in the 3D View Activate tool -It will generate some points along the edge, following various methods""" +It will generate some points along the edge, following various methods""", +) import os -import FreeCAD import FreeCADGui import Part from . import _utils @@ -365,9 +372,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_Discretize", "Usage"), + "
".join(__usage__.splitlines()), + ), + } FreeCADGui.addCommand("Curves_Discretize", discretize()) diff --git a/freecad/Curves/DraftAnalysisFP.py b/freecad/Curves/DraftAnalysisFP.py index 7aa75f6..1aef2d7 100644 --- a/freecad/Curves/DraftAnalysisFP.py +++ b/freecad/Curves/DraftAnalysisFP.py @@ -1,13 +1,19 @@ # -*- coding: utf-8 -*- -__title__ = 'Draft Analysis' -__author__ = 'Christophe Grellier (Chris_G)' -__license__ = 'LGPL 2.1' -__doc__ = '''Create a colored overlay on an object to visualize draft angles. +import FreeCAD + +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_DraftAnalysis", "Draft Analysis") +__author__ = "Christophe Grellier (Chris_G)" +__license__ = "LGPL 2.1" +__doc__ = QT_TRANSLATE_NOOP( + "Curves_DraftAnalysis", + """Create a colored overlay on an object to visualize draft angles. Tool options are in the View tab. -Mouse clics in the colored areas print measured draft angle in the Report View.''' +Mouse clics in the colored areas print measured draft angle in the Report View.""", +) -import FreeCAD import FreeCADGui import Part from os import path diff --git a/freecad/Curves/ExtractShapes.py b/freecad/Curves/ExtractShapes.py index 02aa418..08aa27b 100644 --- a/freecad/Curves/ExtractShapes.py +++ b/freecad/Curves/ExtractShapes.py @@ -1,21 +1,29 @@ # -*- coding: utf-8 -*- -__title__ = "Extract subshape" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_ExtractSubshape", "Extract subshape") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = """Make a non-parametric copy of selected subshapes. -Same as Part_ElementCopy""" +__doc__ = translate( + "Curves_ExtractSubshape", + """Make a non-parametric copy of selected subshapes. +Same as Part_ElementCopy""", +) import os -import FreeCAD import FreeCADGui from freecad.Curves import ICONPATH -TOOL_ICON = os.path.join(ICONPATH, 'extract.svg') +TOOL_ICON = os.path.join(ICONPATH, "extract.svg") class extract: """Make a non-parametric copy of selected subshapes.""" + def Activated(self): s = FreeCADGui.Selection.getSelectionEx() for o in s: @@ -31,9 +39,11 @@ def Activated(self): FreeCAD.ActiveDocument.recompute() def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}\n\n{}".format(__title__, __doc__)} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}\n\n{}".format(__title__, __doc__), + } FreeCADGui.addCommand("Curves_ExtractSubshape", extract()) diff --git a/freecad/Curves/FlattenFP.py b/freecad/Curves/FlattenFP.py index 70f0628..d9e7415 100644 --- a/freecad/Curves/FlattenFP.py +++ b/freecad/Curves/FlattenFP.py @@ -1,15 +1,24 @@ # -*- coding: utf-8 -*- -__title__ = 'Flatten face' -__author__ = 'Christophe Grellier (Chris_G)' -__license__ = 'LGPL 2.1' -__doc__ = 'Creates a flat developed face from conical and cylindrical faces' -__usage__ = """You must select a conical or cylindrical face in the 3D View. +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_FlattenFace", "Flatten face") +__author__ = "Christophe Grellier (Chris_G)" +__license__ = "LGPL 2.1" +__doc__ = translate( + "Curves_FlattenFace", "Creates a flat developed face from conical and cylindrical faces" +) +__usage__ = translate( + "Curves_FlattenFace", + """You must select a conical or cylindrical face in the 3D View. InPlace property puts the unrolled face tangent to the source face (InPlace = True) -or in the XY plane (InPlace = False)""" +or in the XY plane (InPlace = False)""", +) import os -import FreeCAD import FreeCADGui import Part from math import pi @@ -432,9 +441,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} - - -FreeCADGui.addCommand('Curves_FlattenFace', Curves_Flatten_Face_Cmd()) + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_FlattenFace", "Usage"), + "
".join(__usage__.splitlines()), + ), + } + + +FreeCADGui.addCommand("Curves_FlattenFace", Curves_Flatten_Face_Cmd()) diff --git a/freecad/Curves/GeomInfo.py b/freecad/Curves/GeomInfo.py index b710d4e..4fb77a3 100644 --- a/freecad/Curves/GeomInfo.py +++ b/freecad/Curves/GeomInfo.py @@ -1,16 +1,23 @@ # -*- coding: utf-8 -*- -__title__ = "GeomInfo" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_GeometryInfo", "GeomInfo") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Display geometry information about selected shape" -__usage__ = """While active, this tool displays information about the geometry of an edge or face. -It displays poles, knots and weights of Bezier and BSpline curves and surfaces in the 3D View.""" +__doc__ = translate("Curves_GeometryInfo", "Display geometry information about selected shape") +__usage__ = translate( + "Curves_GeometryInfo", + """While active, this tool displays information about the geometry of an edge or face. +It displays poles, knots and weights of Bezier and BSpline curves and surfaces in the 3D View.""", +) import os import re -import FreeCAD import FreeCADGui import Part from . import _utils diff --git a/freecad/Curves/IsoCurve.py b/freecad/Curves/IsoCurve.py index 9b35c89..ea1d200 100644 --- a/freecad/Curves/IsoCurve.py +++ b/freecad/Curves/IsoCurve.py @@ -235,10 +235,14 @@ class CommandMacroIsoCurve: "Command to create IsoCurve feature" def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': "IsoCurve", - 'Accel': "", - 'ToolTip': "IsoCurve: Create an IsoCurve from a face"} + return { + "Pixmap": TOOL_ICON, + "MenuText": QT_TRANSLATE_NOOP("Curves_IsoCurve", "IsoCurve"), + "Accel": "", + "ToolTip": QT_TRANSLATE_NOOP( + "Curves_IsoCurve", "IsoCurve: Create an IsoCurve from a face" + ), + } def Activated(self): run() diff --git a/freecad/Curves/JoinCurves.py b/freecad/Curves/JoinCurves.py index dfe615a..2a699d4 100644 --- a/freecad/Curves/JoinCurves.py +++ b/freecad/Curves/JoinCurves.py @@ -1,15 +1,22 @@ # -*- coding: utf-8 -*- -__title__ = "joinCurves" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_JoinCurve", "joinCurves") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Joins the selected edges into a BSpline Curve" -__usage__ = """Select the edges to join in the 3D View, or select an object containing multiple edges in the Tree View. +__doc__ = translate("Curves_JoinCurve", "Joins the selected edges into a BSpline Curve") +__usage__ = translate( + "Curves_JoinCurve", + """Select the edges to join in the 3D View, or select an object containing multiple edges in the Tree View. Activate the tool. -The output is a single BSpline curve joining all selected edges.""" +The output is a single BSpline curve joining all selected edges.""", +) import os -import FreeCAD import FreeCADGui import Part from . import _utils @@ -293,9 +300,13 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, translate("Curves_JoinCurve", "Usage"), "
".join(__usage__.splitlines()) + ), + } FreeCADGui.addCommand("Curves_JoinCurve", joinCommand()) diff --git a/freecad/Curves/ParametricBlendCurve.py b/freecad/Curves/ParametricBlendCurve.py index a7503bf..9242265 100644 --- a/freecad/Curves/ParametricBlendCurve.py +++ b/freecad/Curves/ParametricBlendCurve.py @@ -1,12 +1,19 @@ # -*- coding: utf-8 -*- -__title__ = "Blend curve" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_ParametricBlendCurve", "Blend curve") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Blend curve between two edges. Double-clic object to enable/disable freehand mouse editing." +__doc__ = QT_TRANSLATE_NOOP( + "Curves_ParametricBlendCurve", + "Blend curve between two edges. Double-clic object to enable/disable freehand mouse editing.", +) import os -import FreeCAD import FreeCADGui import Part from freecad.Curves import _utils diff --git a/freecad/Curves/ParametricComb.py b/freecad/Curves/ParametricComb.py index 954bbcf..95294ea 100644 --- a/freecad/Curves/ParametricComb.py +++ b/freecad/Curves/ParametricComb.py @@ -1,12 +1,18 @@ # -*- coding: utf-8 -*- -__title__ = "Comb plot" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_ParametricComb", "Comb plot") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = 'Creates a parametric Comb plot on selected edges' +__doc__ = QT_TRANSLATE_NOOP( + "Curves_ParametricComb", "Creates a parametric Comb plot on selected edges" +) import os -import FreeCAD import FreeCADGui import Part # from freecad.Curves import _utils diff --git a/freecad/Curves/ProfileSketch.py b/freecad/Curves/ProfileSketch.py index 2e08a69..9b3203c 100644 --- a/freecad/Curves/ProfileSketch.py +++ b/freecad/Curves/ProfileSketch.py @@ -5,9 +5,10 @@ translate = FreeCAD.Qt.translate QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +__title__ = QT_TRANSLATE_NOOP("Curves_ProfileSupportPlane", "Profile support plane") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = 'Creates a support plane for sketches' +__doc__ = QT_TRANSLATE_NOOP("Curves_ProfileSupportPlane", "Creates a support plane for sketches") import os import FreeCADGui diff --git a/freecad/Curves/ProfileSupportFP.py b/freecad/Curves/ProfileSupportFP.py index c545463..59df1f5 100644 --- a/freecad/Curves/ProfileSupportFP.py +++ b/freecad/Curves/ProfileSupportFP.py @@ -1,12 +1,15 @@ # -*- coding: utf-8 -*- -__title__ = 'Profile Support' -__author__ = 'Christophe Grellier (Chris_G)' -__license__ = 'LGPL 2.1' -__doc__ = 'Creates a support shape between two rails' +import FreeCAD + +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_ProfileSupport", "Profile Support") +__author__ = "Christophe Grellier (Chris_G)" +__license__ = "LGPL 2.1" +__doc__ = QT_TRANSLATE_NOOP("Curves_ProfileSupport", "Creates a support shape between two rails") import os -import FreeCAD import FreeCADGui import Part # from freecad.Curves import _utils diff --git a/freecad/Curves/ReflectLinesFP.py b/freecad/Curves/ReflectLinesFP.py index 7391271..612a95e 100644 --- a/freecad/Curves/ReflectLinesFP.py +++ b/freecad/Curves/ReflectLinesFP.py @@ -1,16 +1,26 @@ # -*- coding: utf-8 -*- -__title__ = "Reflect Lines" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_ReflectLines", "Reflect Lines") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Creates the reflect lines on a shape, according to a view direction" -__usage__ = """Select an object and activate tool. +__doc__ = translate( + "Curves_ReflectLines", "Creates the reflect lines on a shape, according to a view direction" +) +__usage__ = translate( + "Curves_ReflectLines", + """Select an object and activate tool. This will create reflect lines according to the current view direction. If selected object is a ReflectLines object, the view direction will be updated to the current camera direction. If property OnShape is True, the lines will be ON the input shape (ViewPos and UpDir properties won't be used). Otherwise, lines will be on the XY plane. If view property TrackCam is True, the view direction will keep updating upon camera movements. -""" +""", +) import os import FreeCAD @@ -206,9 +216,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_ReflectLines", "Usage"), + "
".join(__usage__.splitlines()), + ), + } FreeCADGui.addCommand("Curves_ReflectLines", ReflectLinesCommand()) diff --git a/freecad/Curves/RotationSweepFP.py b/freecad/Curves/RotationSweepFP.py index aa6ded8..e39512a 100644 --- a/freecad/Curves/RotationSweepFP.py +++ b/freecad/Curves/RotationSweepFP.py @@ -1,11 +1,19 @@ # -*- coding: utf-8 -*- -__title__ = 'Rotation Sweep' -__author__ = 'Christophe Grellier (Chris_G)' -__license__ = 'LGPL 2.1' -__doc__ = 'Sweep some profiles along a path, and around a point' -__usage__ = """Select a sweep path and some profiles in the 3D View. -If TrimPath is False, the Sweep surface will be extrapolated to fit the whole path.""" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_RotationSweep", "Rotation Sweep") +__author__ = "Christophe Grellier (Chris_G)" +__license__ = "LGPL 2.1" +__doc__ = translate("Curves_RotationSweep", "Sweep some profiles along a path, and around a point") +__usage__ = translate( + "Curves_RotationSweep", + """Select a sweep path and some profiles in the 3D View. +If TrimPath is False, the Sweep surface will be extrapolated to fit the whole path.""", +) import os import FreeCAD @@ -210,9 +218,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_RotationSweep", "Usage"), + "
".join(__usage__.splitlines()), + ), + } FreeCADGui.addCommand("Curves_RotationSweep", RotsweepFPCommand()) diff --git a/freecad/Curves/Sketch_On_Surface.py b/freecad/Curves/Sketch_On_Surface.py index dcb1792..f1a23f4 100644 --- a/freecad/Curves/Sketch_On_Surface.py +++ b/freecad/Curves/Sketch_On_Surface.py @@ -1,12 +1,15 @@ # -*- coding: utf-8 -*- -__title__ = "Sketch on surface" +import FreeCAD + +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_SketchOnSurface", "Sketch on surface") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Map a sketch on a surface" +__doc__ = QT_TRANSLATE_NOOP("Curves_SketchOnSurface", "Map a sketch on a surface") import os -import FreeCAD import FreeCADGui import Part import Sketcher diff --git a/freecad/Curves/SurfaceAnalysisFP.py b/freecad/Curves/SurfaceAnalysisFP.py index 2b1dfe8..64d15e1 100644 --- a/freecad/Curves/SurfaceAnalysisFP.py +++ b/freecad/Curves/SurfaceAnalysisFP.py @@ -1,13 +1,18 @@ # -*- coding: utf-8 -*- -__title__ = 'Title' -__author__ = 'Christophe Grellier (Chris_G)' -__license__ = 'LGPL 2.1' -__doc__ = 'Doc' +import FreeCAD + +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +# TODO: include useful __doc__ +__title__ = QT_TRANSLATE_NOOP("Curves_SurfaceAnalysis", "Surface Analysis") +__author__ = "Christophe Grellier (Chris_G)" +__license__ = "LGPL 2.1" +__doc__ = QT_TRANSLATE_NOOP("Curves_SurfaceAnalysis", "Doc") # import os -import FreeCAD import FreeCADGui + # from pivy import coin from os import path from math import pi diff --git a/freecad/Curves/Sweep2Rails.py b/freecad/Curves/Sweep2Rails.py index 9f7c5fa..44fc03d 100644 --- a/freecad/Curves/Sweep2Rails.py +++ b/freecad/Curves/Sweep2Rails.py @@ -266,9 +266,11 @@ def Activated(self): FreeCAD.ActiveDocument.recompute() def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': 'Sweep2Rails', - 'ToolTip': 'Sweep profiles on 2 rails'} + return { + "Pixmap": TOOL_ICON, + "MenuText": QT_TRANSLATE_NOOP("Curves_SweepToRails", "Sweep2Rails"), + "ToolTip": QT_TRANSLATE_NOOP("Curves_SweepToRails", "Sweep profiles on 2 rails"), + } FreeCADGui.addCommand("Curves_SweepToRails", s2rCommand()) diff --git a/freecad/Curves/TrimFace.py b/freecad/Curves/TrimFace.py index 55234f8..864d4b9 100644 --- a/freecad/Curves/TrimFace.py +++ b/freecad/Curves/TrimFace.py @@ -1,12 +1,16 @@ # -*- coding: utf-8 -*- -__title__ = 'Trim face' -__author__ = 'Christophe Grellier (Chris_G)' -__license__ = 'LGPL 2.1' -__doc__ = 'Trim a face with a projected curve' +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_Trim", "Trim face") +__author__ = "Christophe Grellier (Chris_G)" +__license__ = "LGPL 2.1" +__doc__ = QT_TRANSLATE_NOOP("Curves_Trim", "Trim a face with a projected curve") import os -import FreeCAD import FreeCADGui import Part # from freecad.Curves import _utils diff --git a/freecad/Curves/Truncate_Extend_FP.py b/freecad/Curves/Truncate_Extend_FP.py index a861d60..828b5eb 100644 --- a/freecad/Curves/Truncate_Extend_FP.py +++ b/freecad/Curves/Truncate_Extend_FP.py @@ -1,14 +1,20 @@ # -*- coding: utf-8 -*- -__title__ = 'Truncate Extend' -__author__ = 'Christophe Grellier (Chris_G)' -__license__ = 'LGPL 2.1' -__doc__ = '''Cut a shape with a plane and truncate or extend it by a given distance. +import FreeCAD + +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_TruncateExtendCmd", "Truncate Extend") +__author__ = "Christophe Grellier (Chris_G)" +__license__ = "LGPL 2.1" +__doc__ = QT_TRANSLATE_NOOP( + "Curves_TruncateExtendCmd", + """Cut a shape with a plane and truncate or extend it by a given distance. In a PartDesign body, select only the cutting plane. -Otherwise, select the shape to modify, and the cutting plane.''' +Otherwise, select the shape to modify, and the cutting plane.""", +) import os -import FreeCAD import FreeCADGui import Part from freecad.Curves import Truncate_Extend diff --git a/freecad/Curves/ZebraTool.py b/freecad/Curves/ZebraTool.py index fa013e0..1377872 100644 --- a/freecad/Curves/ZebraTool.py +++ b/freecad/Curves/ZebraTool.py @@ -7,7 +7,9 @@ from pivy import coin from freecad.Curves.Gui import Zebra_Gui -TOOL_ICON = os.path.join(ICONPATH, 'zebra.svg') +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +TOOL_ICON = os.path.join(ICONPATH, "zebra.svg") def execute_later(callback, delay=0): @@ -143,9 +145,13 @@ def Activated(self): FreeCAD.Console.PrintMessage(translate("Log", "Zebra already active\n")) def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': 'ZebraTool', - 'ToolTip': 'Zebra texture for surface inspection'} + return { + "Pixmap": TOOL_ICON, + "MenuText": QT_TRANSLATE_NOOP("Curves_ZebraTool", "ZebraTool"), + "ToolTip": QT_TRANSLATE_NOOP( + "Curves_ZebraTool", "Zebra texture for surface inspection" + ), + } FreeCADGui.addCommand("Curves_ZebraTool", ZebraTool()) diff --git a/freecad/Curves/adjacent_faces.py b/freecad/Curves/adjacent_faces.py index ffa1c0b..66ed49c 100644 --- a/freecad/Curves/adjacent_faces.py +++ b/freecad/Curves/adjacent_faces.py @@ -1,11 +1,19 @@ # -*- coding: utf-8 -*- -__title__ = "Select Adjacent faces" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_AdjacentFaces", "Select Adjacent faces") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Select the Adjacent faces of the selected subshape" -__usage__ = """Select a face or an edge in the 3D View, activate tool -and all the faces that touch it will be added to the selection.""" +__doc__ = translate("Curves_AdjacentFaces", "Select the Adjacent faces of the selected subshape") +__usage__ = translate( + "Curves_AdjacentFaces", + """Select a face or an edge in the 3D View, activate tool +and all the faces that touch it will be added to the selection.""", +) import os import FreeCAD @@ -73,9 +81,13 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}
".format(__doc__, __usage__)} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}
".format( + __doc__, translate("Curves_AdjacentFaces", "Usage"), __usage__ + ), + } addCommand("Curves_AdjacentFaces", adjacentfacesCommand()) diff --git a/freecad/Curves/approximate.py b/freecad/Curves/approximate.py index f0f8cec..f251066 100644 --- a/freecad/Curves/approximate.py +++ b/freecad/Curves/approximate.py @@ -478,9 +478,13 @@ def Activated(self): FreeCAD.ActiveDocument.recompute() def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': 'Approximate', - 'ToolTip': 'Approximate points to NURBS curve or surface'} + return { + "Pixmap": TOOL_ICON, + "MenuText": QT_TRANSLATE_NOOP("Curves_Approximate", "Approximate"), + "ToolTip": QT_TRANSLATE_NOOP( + "Curves_Approximate", "Approximate points to NURBS curve or surface" + ), + } FreeCADGui.addCommand("Curves_Approximate", approx()) diff --git a/freecad/Curves/blendSolidFP.py b/freecad/Curves/blendSolidFP.py index 61f103f..7b295ea 100644 --- a/freecad/Curves/blendSolidFP.py +++ b/freecad/Curves/blendSolidFP.py @@ -1,10 +1,20 @@ # -*- coding: utf-8 -*- -__title__ = "BlendSolid" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_BlendSolid", "BlendSolid") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Create a solid between two faces with some continuity with their support shapes" -__usage__ = "Select a face on each of the two solids to blend, in the 3D View." +__doc__ = translate( + "Curves_BlendSolid", + "Create a solid between two faces with some continuity with their support shapes", +) +__usage__ = translate( + "Curves_BlendSolid", "Select a face on each of the two solids to blend, in the 3D View." +) import os import FreeCAD @@ -243,9 +253,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_BlendSolid", "Usage"), + "
".join(__usage__.splitlines()), + ), + } FreeCADGui.addCommand("Curves_BlendSolid", BlendSolidCommand()) diff --git a/freecad/Curves/blendSurfaceFP_new.py b/freecad/Curves/blendSurfaceFP_new.py index 53aaf47..cf1c085 100644 --- a/freecad/Curves/blendSurfaceFP_new.py +++ b/freecad/Curves/blendSurfaceFP_new.py @@ -1,12 +1,23 @@ # -*- coding: utf-8 -*- -__title__ = "BlendSurface" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_BlendSurf2", "BlendSurface") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Create a surface between two edges with some continuity with their support faces" -__usage__ = """You must select 4 subshapes in the 3D View : +__doc__ = translate( + "Curves_BlendSurf2", + "Create a surface between two edges with some continuity with their support faces", +) +__usage__ = translate( + "Curves_BlendSurf2", + """You must select 4 subshapes in the 3D View : - EDGE1 on FACE1 -- EDGE2 on FACE2""" +- EDGE2 on FACE2""", +) import os import FreeCAD @@ -153,9 +164,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_BlendSurf2", "Usage"), + "
".join(__usage__.splitlines()), + ), + } if FreeCAD.GuiUp: diff --git a/freecad/Curves/comp_spring.py b/freecad/Curves/comp_spring.py index 8f1a64a..406e4bd 100644 --- a/freecad/Curves/comp_spring.py +++ b/freecad/Curves/comp_spring.py @@ -4,16 +4,17 @@ QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +__title__ = QT_TRANSLATE_NOOP("Curves_CompressionSpring", "Compression Spring") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = """Parametric Compression Spring""" +__doc__ = QT_TRANSLATE_NOOP("Curves_CompressionSpring", """Parametric Compression Spring""") import sys + if sys.version_info.major >= 3: from importlib import reload import os -import FreeCAD import FreeCADGui import Part from Part import Geom2d diff --git a/freecad/Curves/curveExtendFP.py b/freecad/Curves/curveExtendFP.py index 5ec8326..6ba3807 100644 --- a/freecad/Curves/curveExtendFP.py +++ b/freecad/Curves/curveExtendFP.py @@ -1,11 +1,19 @@ # -*- coding: utf-8 -*- -__title__ = "Curve extend" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_ExtendCurve", "Curve extend") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Extend an edge by a given distance." -__usage__ = """Select an edge in the 3D View, and activate tool. -Edge can be extended at each end, by a given distance.""" +__doc__ = translate("Curves_ExtendCurve", "Extend an edge by a given distance.") +__usage__ = translate( + "Curves_ExtendCurve", + """Select an edge in the 3D View, and activate tool. +Edge can be extended at each end, by a given distance.""", +) import os import FreeCAD @@ -166,8 +174,10 @@ def GetResources(self): return { "Pixmap": TOOL_ICON, "MenuText": __title__, - "ToolTip": "{}

Usage :
{}".format( - __doc__, "
".join(__usage__.splitlines()) + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_ExtendCurve", "Usage"), + "
".join(__usage__.splitlines()), ), } diff --git a/freecad/Curves/curveOnSurfaceFP.py b/freecad/Curves/curveOnSurfaceFP.py index 14cdbd8..401e6e5 100644 --- a/freecad/Curves/curveOnSurfaceFP.py +++ b/freecad/Curves/curveOnSurfaceFP.py @@ -14,7 +14,9 @@ from freecad.Curves import _utils from freecad.Curves import ICONPATH -TOOL_ICON = os.path.join( ICONPATH, 'curveOnSurface.svg') +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +TOOL_ICON = os.path.join(ICONPATH, "curveOnSurface.svg") debug = _utils.debug #debug = _utils.doNothing @@ -205,8 +207,13 @@ def Activated(self): ) def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': 'CurveOnSurface', - 'ToolTip': 'Create a curve on surface object'} + return { + "Pixmap": TOOL_ICON, + "MenuText": QT_TRANSLATE_NOOP("Curves_CurveOnSurface", "CurveOnSurface"), + "ToolTip": QT_TRANSLATE_NOOP( + "Curves_CurveOnSurface", "Create a curve on surface object" + ), + } + FreeCADGui.addCommand("Curves_CurveOnSurface", cosCommand()) diff --git a/freecad/Curves/curve_to_script.py b/freecad/Curves/curve_to_script.py index 499feee..1b6004e 100644 --- a/freecad/Curves/curve_to_script.py +++ b/freecad/Curves/curve_to_script.py @@ -1,11 +1,22 @@ # -*- coding: utf-8 -*- +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + __title__ = "BSpline to script" __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Creates a python script to build the selected BSpline or Bezier geometries." -__usage__ = """Select some Bezier or BSpline curves or surfaces in the 3D View and activate the tool. -The selected curves or surfaces will be re-created with commands in the python console.""" +__doc__ = translate( + "Curves_BsplineToConsole", + "Creates a python script to build the selected BSpline or Bezier geometries.", +) +__usage__ = translate( + "Curves_BsplineToConsole", + """Select some Bezier or BSpline curves or surfaces in the 3D View and activate the tool. +The selected curves or surfaces will be re-created with commands in the python console.""", +) import os import FreeCAD @@ -84,10 +95,16 @@ def nurbs_to_script(i, c): class NurbsToConsole: "Brings the selected BSpline curves to the python console" def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': "BSpline to Console", - 'Accel': "", - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": QT_TRANSLATE_NOOP("Curves_BsplineToConsole", "BSpline to Console"), + "Accel": "", + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_BsplineToConsole", "Usage"), + "
".join(__usage__.splitlines()), + ), + } def Activated(self): s = FreeCADGui.Selection.getSelectionEx() diff --git a/freecad/Curves/gordonFP.py b/freecad/Curves/gordonFP.py index 4efe0d2..17245ce 100644 --- a/freecad/Curves/gordonFP.py +++ b/freecad/Curves/gordonFP.py @@ -5,16 +5,18 @@ translate = FreeCAD.Qt.translate QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP -__title__ = "Parametric Gordon surface" +__title__ = QT_TRANSLATE_NOOP("Curves_GordonSurface", "Parametric Gordon surface") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Creates a surface that skins a network of curves." +__doc__ = QT_TRANSLATE_NOOP( + "Curves_GordonSurface", "Creates a surface that skins a network of curves." +) # from importlib import reload import os -import FreeCAD import FreeCADGui import Part + # from freecad.Curves import _utils from freecad.Curves import ICONPATH from freecad.Curves.gordon import InterpolateCurveNetwork @@ -263,9 +265,7 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': 'Gordon surface', - 'ToolTip': 'Creates a surface that skins a network of curves'} + return {"Pixmap": TOOL_ICON, "MenuText": __title__, "ToolTip": __doc__} FreeCADGui.addCommand("Curves_GordonSurface", gordonCommand()) diff --git a/freecad/Curves/gordon_profile_FP.py b/freecad/Curves/gordon_profile_FP.py index f091c2b..b8efd35 100644 --- a/freecad/Curves/gordon_profile_FP.py +++ b/freecad/Curves/gordon_profile_FP.py @@ -1,10 +1,17 @@ # -*- coding: utf-8 -*- -__title__ = "Freehand BSpline" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_EditableSpline", "Freehand BSpline") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Creates an freehand BSpline curve" -__usage__ = """*** Interpolation curve control keys : +__doc__ = translate("Curves_EditableSpline", "Creates an freehand BSpline curve") +__usage__ = translate( + "Curves_EditableSpline", + """*** Interpolation curve control keys : a - Select all / Deselect i - Insert point in selected segments @@ -13,7 +20,8 @@ s - Snap points on shape / Unsnap l - Set/unset a linear interpolation x,y,z - Axis constraints during grab - q - Apply changes and quit editing""" + q - Apply changes and quit editing""", +) import os import FreeCAD @@ -352,9 +360,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_EditableSpline", "Usage"), + "
".join(__usage__.splitlines()), + ), + } FreeCADGui.addCommand("Curves_EditableSpline", GordonProfileCommand()) diff --git a/freecad/Curves/interpolate.py b/freecad/Curves/interpolate.py index 94bd10d..82c6075 100644 --- a/freecad/Curves/interpolate.py +++ b/freecad/Curves/interpolate.py @@ -1,12 +1,16 @@ # -*- coding: utf-8 -*- -__title__ = "Interpolate" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_Interpolate", "Interpolate") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Interpolate a set of points." +__doc__ = QT_TRANSLATE_NOOP("Curves_Interpolate", "Interpolate a set of points.") import os -import FreeCAD import FreeCADGui import Part from freecad.Curves import _utils diff --git a/freecad/Curves/lineFP.py b/freecad/Curves/lineFP.py index a1dfd56..2c070fd 100644 --- a/freecad/Curves/lineFP.py +++ b/freecad/Curves/lineFP.py @@ -1,10 +1,14 @@ # -*- coding: utf-8 -*- -__title__ = "Parametric line" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +__title__ = QT_TRANSLATE_NOOP("Curves_Line", "Parametric line") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Parametric line between two vertexes." -__usage__ = """Select 2 vertexes in the 3D View and activate the tool.""" +__doc__ = translate("Curves_Line", "Parametric line between two vertexes.") +__usage__ = translate("Curves_Line", "Select 2 vertexes in the 3D View and activate the tool.") import os import FreeCAD @@ -91,9 +95,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_Line", "Usage"), + "
".join(__usage__.splitlines()), + ), + } FreeCADGui.addCommand("Curves_Line", lineCommand()) diff --git a/freecad/Curves/mixed_curve.py b/freecad/Curves/mixed_curve.py index 84e6e72..bd2b6f7 100644 --- a/freecad/Curves/mixed_curve.py +++ b/freecad/Curves/mixed_curve.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- -__title__ = "Mixed curve" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_MixedCurve", "Mixed curve") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Builds a 3D curve as the intersection of 2 projected curves." -__usage__ = """Select two objects or shapes, and activate tool. +__doc__ = translate( + "Curves_MixedCurve", "Builds a 3D curve as the intersection of 2 projected curves." +) +__usage__ = translate( + "Curves_MixedCurve", + """Select two objects or shapes, and activate tool. The camera direction is saved during each shape selection, and will be used as projection direction. -Set these directions to (0,0,0) to use the placement of each shape as projection direction.""" +Set these directions to (0,0,0) to use the placement of each shape as projection direction.""", +) import os import FreeCAD @@ -225,9 +235,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': 'Mixed curve', - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": "Mixed curve", + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_MixedCurve", "Usage"), + "
".join(__usage__.splitlines()), + ), + } FreeCADGui.addCommand("Curves_MixedCurve", MixedCurveCmd()) diff --git a/freecad/Curves/multiLoftFP.py b/freecad/Curves/multiLoftFP.py index a931d8a..9bba598 100644 --- a/freecad/Curves/multiLoftFP.py +++ b/freecad/Curves/multiLoftFP.py @@ -4,9 +4,12 @@ QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP +__title__ = QT_TRANSLATE_NOOP("Curves_MultiLoft", "MultiLoft") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = """Loft profile objects made of multiple faces in parallel""" +__doc__ = QT_TRANSLATE_NOOP( + "Curves_MultiLoft", """Loft profile objects made of multiple faces in parallel""" +) import os import FreeCADGui diff --git a/freecad/Curves/parametricSolid.py b/freecad/Curves/parametricSolid.py index 3ae21b2..e31bfd1 100644 --- a/freecad/Curves/parametricSolid.py +++ b/freecad/Curves/parametricSolid.py @@ -1,17 +1,24 @@ # -*- coding: utf-8 -*- -__title__ = "Parametric solid" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_ParametricSolid", "Parametric solid") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Make a parametric solid from selected faces." -__usage__ = """Select some faces in the 3D View, or select objects in the Tree View. +__doc__ = translate("Curves_ParametricSolid", "Make a parametric solid from selected faces.") +__usage__ = translate( + "Curves_ParametricSolid", + """Select some faces in the 3D View, or select objects in the Tree View. Activate tool. It will try to build a solid from selected faces. If not possible, it falls back to a shell, then to a compound. -The ShapeStatus property (and the color of the icon) give the type of shape.""" +The ShapeStatus property (and the color of the icon) give the type of shape.""", +) import os -import FreeCAD import FreeCADGui import Part import tempfile @@ -195,9 +202,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_ParametricSolid", "Usage"), + "
".join(__usage__.splitlines()), + ), + } FreeCADGui.addCommand("Curves_ParametricSolid", solidCommand()) diff --git a/freecad/Curves/pasteSVG.py b/freecad/Curves/pasteSVG.py index 5aec9aa..3b0822e 100644 --- a/freecad/Curves/pasteSVG.py +++ b/freecad/Curves/pasteSVG.py @@ -1,12 +1,20 @@ # -*- coding: utf-8 -*- -__title__ = "Paste SVG" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_PasteSVG", "Paste SVG") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Paste the SVG content of the clipboard" -__usage__ = """When working in parallel with FreeCAD and a SVG editor (Inkscape), +__doc__ = translate("Curves_PasteSVG", "Paste the SVG content of the clipboard") +__usage__ = translate( + "Curves_PasteSVG", + """When working in parallel with FreeCAD and a SVG editor (Inkscape), copy (CTRL-C) an object in the SVG editor, switch to FreeCAD and activate tool. -This will import the SVG content of the clipboard into the active FreeCAD document.""" +This will import the SVG content of the clipboard into the active FreeCAD document.""", +) import xml.sax import importSVG @@ -43,9 +51,13 @@ def IsActive(self): return True def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, translate("Curves_PasteSVG", "Usage"), "
".join(__usage__.splitlines()) + ), + } FreeCADGui.addCommand("Curves_PasteSVG", pasteSVG()) diff --git a/freecad/Curves/pipeshellFP.py b/freecad/Curves/pipeshellFP.py index 21a77f9..83aa51e 100644 --- a/freecad/Curves/pipeshellFP.py +++ b/freecad/Curves/pipeshellFP.py @@ -1,12 +1,16 @@ # -*- coding: utf-8 -*- -__title__ = 'Pipeshell' +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_Pipeshell", "Pipeshell") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = 'Creates a PipeShell sweep object' +__doc__ = QT_TRANSLATE_NOOP("Curves_Pipeshell", "Creates a PipeShell sweep object") import os -import FreeCAD import FreeCADGui import Part from freecad.Curves import _utils @@ -15,9 +19,6 @@ TOOL_ICON = os.path.join(ICONPATH, 'pipeshell.svg') DEBUG = False -translate = FreeCAD.Qt.translate -QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP - def debug(string): if DEBUG: diff --git a/freecad/Curves/pipeshellProfileFP.py b/freecad/Curves/pipeshellProfileFP.py index 127a9a2..bfe8aa0 100644 --- a/freecad/Curves/pipeshellProfileFP.py +++ b/freecad/Curves/pipeshellProfileFP.py @@ -1,12 +1,16 @@ # -*- coding: utf-8 -*- -__title__ = 'Pipeshell profile' +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_PipeshellProfile", "Pipeshell profile") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = 'Creates a Profile object for PipeShell' +__doc__ = QT_TRANSLATE_NOOP("Curves_PipeshellProfile", "Creates a Profile object for PipeShell") import os -import FreeCAD import FreeCADGui import Part from freecad.Curves import _utils @@ -15,9 +19,6 @@ TOOL_ICON = os.path.join( ICONPATH, 'profile.svg') DEBUG = False -translate = FreeCAD.Qt.translate -QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP - def debug(string): if DEBUG: diff --git a/freecad/Curves/segmentSurfaceFP.py b/freecad/Curves/segmentSurfaceFP.py index df9daad..5b6ae1c 100644 --- a/freecad/Curves/segmentSurfaceFP.py +++ b/freecad/Curves/segmentSurfaceFP.py @@ -1,19 +1,26 @@ # -*- coding: utf-8 -*- -__title__ = "Segment surface" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_SegmentSurface", "Segment surface") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = """Segment a surface on isocurves""" -__usage__ = """Select a face in the 3D view and activate tool. +__doc__ = translate("Curves_SegmentSurface", "Segment a surface on isocurves") +__usage__ = translate( + "Curves_SegmentSurface", + """Select a face in the 3D view and activate tool. The face will be converted to a BSpline surface. In Auto mode, the surface will be segmented along isocurves of highest multiplicity. In Custom mode, it will be segmented along isocurves of specified parameters. These parameters can be provided by an external object that have a NormalizedParameters property, -like the Discretize, or the SplitCurve tools.""" +like the Discretize, or the SplitCurve tools.""", +) import os -import FreeCAD import FreeCADGui import Part from . import ICONPATH @@ -267,9 +274,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_SegmentSurface", "Usage"), + "
".join(__usage__.splitlines()), + ), + } FreeCADGui.addCommand("Curves_SegmentSurface", SegSurfCommand()) diff --git a/freecad/Curves/splitCurves_2.py b/freecad/Curves/splitCurves_2.py index 98ece84..e5cda9c 100644 --- a/freecad/Curves/splitCurves_2.py +++ b/freecad/Curves/splitCurves_2.py @@ -1,20 +1,27 @@ # -*- coding: utf-8 -*- -__title__ = "Split curve" +import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_SplitCurve", "Split curve") __author__ = "Christophe Grellier (Chris_G)" __license__ = "LGPL 2.1" -__doc__ = "Splits the selected edge" -__usage__ = """Select an edge in the 3D View, or an object containing a wire in the Tree View +__doc__ = translate("Curves_SplitCurve", "Splits the selected edge") +__usage__ = translate( + "Curves_SplitCurve", + """Select an edge in the 3D View, or an object containing a wire in the Tree View Activate Tool The selected edges (or wire) will be cut at the specified location. The split locations can be given as real edge parameter, absolute distance(mm) or relative distance (%) The split locations can be set by proximity to cutting objects. Double-click in Tree-View to toggle Freehand editor in 3D View. -""" +""", +) import os -import FreeCAD import FreeCADGui import Part from freecad.Curves import _utils @@ -706,9 +713,15 @@ def IsActive(self): return False def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_SplitCurve", "Usage"), + "
".join(__usage__.splitlines()), + ), + } FreeCADGui.addCommand("Curves_SplitCurve", splitCommand()) diff --git a/freecad/Curves/toConsole.py b/freecad/Curves/toConsole.py index 41c873d..02e5765 100644 --- a/freecad/Curves/toConsole.py +++ b/freecad/Curves/toConsole.py @@ -1,13 +1,22 @@ # -*- coding: utf-8 -*- -__title__ = 'Objects to Console' -__author__ = 'Christophe Grellier (Chris_G)' -__license__ = 'LGPL 2.1' -__doc__ = 'Give access to the selected objects in the python console.' -__usage__ = """Select some objects in the TreeView, or in the 3D View, and activate tool. -Some variables will be created in the python console, to access the selection.""" - import FreeCAD + +translate = FreeCAD.Qt.translate +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + +__title__ = QT_TRANSLATE_NOOP("Curves_ObjectsToConsole", "Objects to Console") +__author__ = "Christophe Grellier (Chris_G)" +__license__ = "LGPL 2.1" +__doc__ = translate( + "Curves_ObjectsToConsole", "Give access to the selected objects in the python console." +) +__usage__ = translate( + "Curves_ObjectsToConsole", + """Select some objects in the TreeView, or in the 3D View, and activate tool. +Some variables will be created in the python console, to access the selection.""", +) + import FreeCADGui import os from freecad.Curves import _utils @@ -21,10 +30,16 @@ class ToConsole: "Brings the selected objects to the python console" def GetResources(self): - return {'Pixmap': TOOL_ICON, - 'MenuText': __title__, - 'Accel': "", - 'ToolTip': "{}

Usage :
{}".format(__doc__, "
".join(__usage__.splitlines()))} + return { + "Pixmap": TOOL_ICON, + "MenuText": __title__, + "Accel": "", + "ToolTip": "{}

{} :
{}".format( + __doc__, + translate("Curves_ObjectsToConsole", "Usage"), + "
".join(__usage__.splitlines()), + ), + } def Activated(self): doc = '' From bca78300db651fbc5d826690766aec708427419f Mon Sep 17 00:00:00 2001 From: hasecilu Date: Mon, 9 Dec 2024 11:30:50 -0600 Subject: [PATCH 7/7] Add Spanish translations Only 25%, all commands MenuText and ToolTip translated --- .../resources/translations/Curves_es-ES.qm | Bin 0 -> 29883 bytes .../resources/translations/Curves_es-ES.ts | 3227 +++++++++++++++++ 2 files changed, 3227 insertions(+) create mode 100644 freecad/Curves/resources/translations/Curves_es-ES.qm create mode 100644 freecad/Curves/resources/translations/Curves_es-ES.ts diff --git a/freecad/Curves/resources/translations/Curves_es-ES.qm b/freecad/Curves/resources/translations/Curves_es-ES.qm new file mode 100644 index 0000000000000000000000000000000000000000..5755a9ea461194f3b3b56c1aeb0c14b6671fa76f GIT binary patch literal 29883 zcmb__3zQsJdFE}6G?GT68CiZ4Y?oj1j2Ow1Fg6GSmS#q>Y`s=Jk{@eh_jK3Hw5F%4 zsqPtRWSl2)90;6*K!AfGAsd1h$nL?c_i(%+*}Nbjfxy{avLP(H+MFze!)}r#@!4=r z$bR4d*S)u@yQ)Vbv5wp`T~+t~_rL%D{m)yv_cOKYzVKJiz4wbZzw$Sq{K#kj+sBMC z8^ZPz)8&K4tbZ224H>ieL-_Lb#;kjfF%OoF2}{QO_}7eCy4S3K>A&Efd9&eX)*BPu zV6H8H*qEuenrq*;-I&rJo0-jT#(lqL9(n)mxPHz&_CDOd;WPTV`5yfo`k(qa`Vabf z)w}fbhL7uKu%w^2KB1p?ep)~G{+WK>y`rD5zh6Hm@6*qzWBOTsR6o!BrG7sCxPI2Y zY{IwwoiVTaujW6z{C#6~jhX*^6m;HtRcZ5$O=Gr)rQKh+&6v}FT{?8~MPqiJC_VJq zM~!KGyj1xDo?HJHrTH&?+n6{1Xz6EvAM1YoS4;ou#-G4*|EKh+&Kr$6yQB1nzlG1? zca;9e-IK=La!2X=AOEy5Z}_!!*Z&E|tDRX_eeGSw-09{dB z-o5UR|J|3t@9PJyzIP|)n;E#}qu(`VZtK8nJ~)l}UNP{d_hG)PeskdP>%jLnJUZ}X z^AXVfa|6#l4Em1#2iAZ1%b;iQPuG9qTcB@UZT%;o16@l`um9WMKW)rI|9ZoL z?E~2V=QgZ-3hQ3{`3)}|d$TbQ4{i934_1xY{2vF0zx{n<_HG&+odSLHuN%C2|2K@; z`uyOnfAN#x&yNi5dFl7C?k$6F{55e&zxl<#HRkZ_;QwuH zGp78`!GC!2yfMwsZM@;84#pkd`0zaV`QS%4{>Y!c%b3^QzVY+#z;kzhY~z=|@lj)T ztlRk2Pfr`OXKdqlzlD7+4R12fjTm#su1&#LxX#yX+J6PswegNki}!)<*Z$t7XP){M zW9pyVyzM;JHU4v(55*zm;wzhH*MZIlcWr*=tKY%C|KZU7Kf?X5dTwapSzI4})zGsy zV?En%8v5AC9mY(q4E@f?8?nz{9eVj);M1PfEqlxlW4|tLdHlV*jd}GwTYl`NTa7vL z%$Co69s9ZX*zlDG9GZyC1{8 znhy?t;y1AF^0&7hc=y|kdDEG#b6@y#@a3AVKXLn)jM;SW*5{9X-k5E7ZT;jcFyFxb zt$#+nebu#Fzw;r`Ik;zJVEJ9xpTUtWpZp%?zkB4`2d>5a9~!yg(WWtPe87ZA(Z6~%9A3^RWUmX3)H?Zz?zdQPOA0Ebj|MKX|&s~jmzg#z_ zwP^qo?lH&AUz(1IObven{6Ccc*G=10O^n| z&n$t2I7M2^ESshf+;-$PFlKps1bB3@qE}R7<$+o#A6ra;n+Pmcrd(B4`V*FWpX)Q z38!oIP818rwwXyx*96-`!}X<}nyfUdVI%jc8_hJfurB@bB_&9h4XPJTi>&E3JaIr5@GQR zUw7ic-0@#)%EF`&Pf~S4%K5_FNKEdwsi34w}3i767SY;NJSf0VslX_s=x!G?$2Y4 zS~3pTq>9En8~Cf-1}2!@ZeLdtPF944K@^;Z~XR zIa{RylE)-2xl2&6bOlDsfMo#19M~5F5XhJ;OH=^CILDTK30t^4D@w^a0Zsf?*MhaR zmuK4xm6oVR@sbA3X-w+%X~XGuMUk}lneEW47D$f3kh&1=b!!VSJC4rRm#`yb=5{Oh z{%e7yGrePA`B_j_=}#aBSC50%Qvkp+ex{9SLke3WZF8W58XG!BO{C~Z(3-n_{Pd}V z<)BK8q)fG!V+u(>LT@yOFijhSdpKyrfHm+<8i98#+)L7QuW&UDU&A$0FtlnC6pdS?L_m%^YLH9Pg@a=o(({lb@! z!#bJUYDIA;5GfQ8EMUrea?~mx0Tt(nL|mX^r1v%&ScEQ1Khuom_x6c8mP%CYhngOV z4s;ei69G60xAVdFIK;T2X^F&W3e6#s{ndA&yI`l_laPB zvPUo#j(SE;_|_3I_9B|LN945?ydO+V)3&Ccke>8Hsw>QhDLu8eO5`PosWa6D9J=6)FIUAX4}!0-rEX9hp*bz8+-lUDH15G<)P$x9SYK<=wJld?qU4&0@~`%YGWpLS zgnnoTJW!E33G3W33z(4z*#bP!#iQtYgtm5l9&|<$Ls0PlH}2yu(G;cEK`2W3=lCse z-w9pql&kZg3UM1y+ge5J(+m&~)mwC0g4yMI18z#%u3L`4e5uKjHbkx(Gsj;_F&LfLr&apK(u z(d=0SrDW69mQ8ekPc+MFG=)byKvy>n{T%EO8On{Z#^~3;7WSrseAqDLl0bs*)^hl7 zg~mhqqc|@(?S%MnS$$=uTxLb2ydvJ<$9Lf+BTZ;UtYV)}NNH06iduI(OGp|gx})lsvk0UD!T?*dt$%~7fjI+u^>?K~g`z6!sJhu3xRaxGnCi`pNct`c zk8E1W^H9S&-odm24FEq?eV8iZlb$nnooT)Vaz8VdD!N6gryOOpY$M_@<&nMMu{3H# zG0bGN62^_nDp3`ACdbC6nGE+=+5v4_2eMuPjDv#I_;#>Up~Tl5Gn2TQA}I%&mBwnj zE;&YX8&IYR=26%v$X-ZN%yXt>LP08Xe z+Z|KM^6s1cp8LUsYK*;?IKXKfW1b;AuYV|qjDX6x*C!A;6ZPm$iMz5cUpjkZixhsm zdNSS-jKJsUj;Ka@IJH{A>+^|JawM)bJD1X-PNJWKaR+Ih#@!r!HldueG2u$hW0avB z2+SBHn2CyXderjC8-oYvRLiU; zRZ=u@&x==W&1Lbv6BF%P8mV#5BZ0GuzZa76Pk{zfr`}o~8irDk36Qd!z%zU{kf&={ zm*O5Jk82^#Ok7g}$bY|wZ^0GihDLpwreKJm-UX$M{9p>52y<4(u)7w@j*4ViRVzKZ zbLY6>6+5SL?WXq}fKP zO!J*Y3BAl@a5%q&dPH09?8rDB46uy*5oZFmSgaUZAv)FI`@mX9&2hQ8g_{pF>hr0= z6#jIqHpgmKS~kZ@x06|C41T)V#swLqp)=m8^Hlle(jOqK*cDwB@wLwA%<1?QWWzT_oQO=1`RaWwmTrmv)nLh}zkc zQdoP^Z76kTW?Ey8V&A9_w{8P&oriu=(`i7|s$0J#i5narlB!^MzJqiq$+1;{Y57JX z2ib%(sbM)-dMl`Y*3}^3(9QB2MQ~I&VrjFEji8#T1K}O~TXjO`+|RB;iRSAo$Ya;) zZODC9-TVUj{u%xJA2iQFLCf-i&YCh_O%)-_ZjCxVoLnm>r8SY^&lCU&-Ex)7COGb$|8!bGrIu#Lx=meVi8;x4 zFC>Ww<3w{$hnWEbLCIHVPvUpFGEZRfbd%JT?tos>w(6Grz_H3=2*qed&0Q^@-Ka(_ zIJ|QyBa$o|{%sj4kN{39k|CWZrW+xR%Ovh!i&@VUFpGp*X0(ND^%%((6<}Ii`bhpR zi$3}+?QT_YiE*0xptQpThXyjXOxvk3P^abfkH*0VzX_sJ&4^ zYZ*Qg%LL0!c#RD!zt*!uq$)LpXgS7H6x?9Uj`4-CR?Kbq5RIH<{+vuMx3b4E$?M40vB(K_1$SRgH z7sY5oV4Aox8!ZFRrL09?*mgx+nV|Y%t)HwO!84+`dqgTc0c(=(_H`4-;yC0~(fFme zgH^Wui@2vT6j?`&@Wl`{)Ee1PzKe1>OMrg8OHs6l@f?}*OdZQIyLdA!Mi3#a%Vm*4 zQG@z^tcwC0b7~w4=vOiuxU(GBJ0>$KmfwB3LQm?Ry#+es8dPtO)RBtQGzN_$DpUMDE4s#cwu`Y zSZqd6RR#v)-&9i;E7y;x@gENG&8B#IZgR*7%5QfaeFhoiU_WvUVPA-9v) zdZ08M2G9_nvz6P7W99bs`c%C}=dpDWvagtes{{kG*(hJH*y3aMO!rXgYeABOd7~t} zr8~eCFtfs}5ABGqFP&ZSJbqxg;;kSMvaEm079?W7F2sUIx8E~n=h*McR?WbEhtL^bmp1+t z(lv*YV>6kHs!c^tLll26_M5FC_w@O-WT3@yYS#nk_*E0@42kxa)SIxb6&L0^c5X}9 z$p_^}^0V~uoTO#i|LQiT*#>@lI_hkKQw9-z-rB&thA<0C_@+?bg1%wz*z|PmKcnUD&iejHAI{*G_QYz=S!N*cVWQhtr)i!^SThP71 zV2sIWiy2Iw^6Wqoo;jTxO+hy^h8$I!yxUJ4#qR=853D^PCZfo40*Zz8Kvpm*!(+ya z6ga=(w|7mP=_*4ds1u$~dTn~hd26nIQ=0eTZ}*fIhw?T0vU5g`bN3_?yDzZRc8O|N zp2kXBE{BU_&z{vk3u{4>rcnT^$g~A{D9g@tHGs@VS@(>NtD0P*nC}a>_Jll4i5`B_ z5OY=TW>84{NN?r62iZYI#evsUmA+r3EvU)B?J#a@s+)#%AEPNYN+3j#8`Vd#1>?$ZETuXLL3aze@_l@B=(?s%j9KZXzz0yaaRxZ(7 z)_jwl-HNK`gkNu3;Is3m`IEaQr`msGjS(7;lR}J`9R{@sFBn2}{aCJ;)<{B z(3Z3-D-iXhup-G=t=y;qLEx;T*`_g+t1&d|(xN2{tX-)H2|?D87Eq7!Uow6Q#`a9$ z&p3Z%y_<@MXsRj+Luy@W-lDOK)u)dM%hxyac5?zdrbn~Vai>2m!vJiqNYO?uCeeuc zVx#?Tw8~-tb&R^Ld`~-(>VPt+P_0t_r~7lgZQg$v@i{~s$EQTVC{fPkvCK;XQtJ&oNEsQDdtYwCfe=>+B7{GUgEjlou*B&n&M@R_o?hz z&oU3Vu=9-dW1c3^^JCSde>PXrkUm04 zn24y8PatNdl{QaA`XHKZrOkcpl{v>koTKDqc8eSa@lMGPski=wcX#Cm@8$fze#2s; zxV7DGH9^8A3gL<2t|>U$+-iz7!H+7%Sg)Flz;Ot>X|dp7X9TEjH4fU7Ung|^!obE zJ)K@z8&?qa1z{MwK5&7ksPnzM1t)0=cOYOC*4Wq9-lj;Y4g3+x)$kV zwz+%ZI*pX=RmfQ#3!IGfNQqrt`Y2fON>rSby|hGJPuh-WF~{07-siDrA}OY(mZAsf zB&+2tl~{8T09#x3D=G89oov)?Fc|5>fw^1Y7`e?4p=Z*_s6NB5JHDnp>g9poZQI34 zW%NglDG|MVqSB|;o185gN%?;fyQfyIH>H$c2jP831dtS#xc?V1kF_}js&q(7I@8SM zDwM(5B<3Yb0A?>kAz9^6t>7Bz8?s+UfseM$hPVVy&ZyeQIe12iG}D$%$Ws=W{9TNQ zm>nkUF}>yEIgJ{!wbrsgBY~nUvvu$!sTz~0OF@_1q5no*A?FFY3N)OZ(GTM}?cwD$ z@`kIjFy#GVrvs(!Y5VK^R(fjA(!%(vE;xrbv81`#Fgf00yT&{5D($NtjjE`mYtFb! zyM~U;p{IfEa5ydk7{3VKo z8HMY^4h=S+thCWuUp{k~FkqAW@+H0#csZVV+{=R|VVHEL(M|?VcAPSx5f9~;`a=1l zS@)U19Xd6cf~i>9Mq7kbD}-r{dTTbS#L^j-OII;7@@_AEU2-uLQYDv)PLH4>4VV^a zEOsX07nWgtfV2Uu7()}Sko>dQ+6O(!5ig(s|VmFig$Hvh@u zAY*vo;NH-ivt39OEKjcol3YV;AJ)fhkRZh}hA~0?eR^ zVX<9>7LQL1NlVk%kMal$$3ZLF(4zOOcvQNLzB$IBnU`bvi?(Tc8?d2IeSS9rvk>} zzbZnJ4YaS9xAYy}7d@Ft$lw@K?72Z=Z9L{ykUSuK*e}TH>G?sn;R-jhO%AO&?MxS| z$N+Dk?N%_+Vzr%UqV7_*I6?{PhV^mJoXoo&GI0_5wHtCY%X#R^$FjZ+Lb!7aOjVWy zHLq3^UoBz4 zFNVMiec8_|Y+RjL`bqXw$@=etbgV^GF-NYp9I=}qM366Q&HH}G9GWv5;b?ax<0blr zIxmG`POSP_Fv6NBK9Lrv33oq%oL;GRWvGFospI{{nQoWMax9*-EGCe~;helpiM2np z$)J%-ohjs{t5vj&&<=>pmOZyXPT1C~Q#u5zg?bVyU4JZCt|Mk^@^m1N_ZxQoV~}W7 z7ys%gs#c!4zx)iGH`F$_rjgC1?40gr_x@PdM|boRb_i=xW3A~J#vK~%sGE>=XnNy6 z&HGZ0$n-p}oN^M!1siQ1Sr)03tb zaaG6SyuI}6E~(_45kqheh^4t{O7CerGllPCxU`gnDOn?yuXX4Nh4Y%|NGwW6N>O=qwAO=v_>8{%a0h8&J}a zn)rhfK6ee^GUdyyn!ITu@q4Sublnw6nXqO1neko$IYox0usc~NP&;5V@F$LI)ZJuj zj8-nknAkrV!Er@=e!4Y`j|SJdsThgk-?bKp3Wi= zcE=}b47260lp6>YAw*G8Ecm6>k0mV+3{-Y1)=4apFZQv@K8N460pA;w{8m_1!fqO= zni4Rhr4FwgpMh9iP;37lTnAlwaq%gzAITh zYj{vz7T5s}@`8zqtTJhsh?($%dnwJdeZ{|zIunC&YFs_!d?8d}?{2d7VaSbT zJ$a{@4htcY=Xm zSOXszkW+*DYqj0+OMN#AQQ)YI>c>~(tgf!QUYgjaBdAQaa+kAw+@ola?K0&&(}G4c z0RtEkB~vk-ivaZ;>r16|quS5L~38a%L;Y#Y1u z&iv=KJi-}hGe|E5+&Z~L4UTM!cXlL2lf1yhp015C9vxiUWt{GpwsK@=p=+mn=37fS zHg`oi$}6-`)B#;NDdYhe%^hpY8{KPtX&re($DQ)R`H7z7Q+^SQSL{paSP0d=_SDNw zNCHhwX9TW4hIc$vk}Ow}i&3jWb6{&!Wl4g$mx4*MYo{cgTs95!SJJbkQ3DL!7rPh6AMf7Gg_Y1cMa7dYT<`sKYS zT@j2via9uEwmFuFYZD866FDmsdfvm*PLyU6(PB3dl-Nzm6cu|B-&*N3FWBY7bY?^B z7H83Y_iu`zmrgs^z>D6EtH4)3u6O-MWFdq>da zjI>NcjsSTBG=W3PXcJmS!5%$h@?w&)rKNEij5y?rfnaj%g<$OVaiukX9v%#Y`GP6K zYuNctZkS?F&3ED?b_@nE)wZ@szK|!om_Fg%ooJqCjNFT5l1eIWa{(t&-}YF0b0&cQ z3ds#x1y==5j@Q|ZG+X2u--%c-)V)1Jsbprgy#V*zWY@`L=oaRlr8~*`ETXstp@7su zkctAgn{;3*s%A{1+A;f5HR03*8V>Sb%ht~nZ%e|t%nRC_1qn|Ww zh@R3@rhQcV;X}>qHGX!XGvdsBfvfP@{FB@?6P;q^Pu9ir+1w%ysm6rLpEto4d3K*X zN^TVn$u0_7Hfy6OR@QIv5g)H}E&hr>*Qvg_%}a@8benYxlP7R*#3Pnh*jK1O>C-@@ z&YpMT-HE98Qk78S#@;MrbL6}sO1}#C$S%qgp3d;67sc(P3Mhy&DWWMAhEH5HC%0h& z4VeZnnrT*ZV9kkTQJ$&O&_#{;v|}g@vDWxFhBYr5%5)(8G+%rT4ZGL!oDmIpwcCu8 z(L|(IlV`3ts$HY*P)WHOZB0#8sceC_+ll)098^qGV*Pg;2cF2t-aU*?v=fO%i=SZl)efN(&c6 z!?9x24ie}nYmfh!yd;t*<*1k361(YqQNDiT{R)-kpj~0)&&O0!s zB)R^9qtSe6;2-gy8)#%GIngU&Vd^fBd6oZnkN8g}nWxOtsUf%MzkswqcM4vmop{;=ATlW1HmhyHgg8b#_TP`vSt)mn+5920^xR|85C+R3|6-XO0l|CxMVa^V zg|{nvHa+z;-UgYu4gnc)APNW7!lq4U#`60B;&4$hDf=D>u z*P`hqUwGJX40#Gk`gh%Y4fdcXQcq2@DRD>gCYqBY<68Bhaq?zEVVso~Z7`u$6Pjtj zyvsm?BmdwS_Di8UNAFX#Ou*5%E5*CKYIsi;DDbRoQjl zHaI!?6}nBf4%hX>u!u652Cu;F{Dv~#S0?U8iirJ%u%?KbUZ;N33wPTUS?yX0nJI#v K#j4kpO8*}#FW+bY literal 0 HcmV?d00001 diff --git a/freecad/Curves/resources/translations/Curves_es-ES.ts b/freecad/Curves/resources/translations/Curves_es-ES.ts new file mode 100644 index 0000000..ae8d0b9 --- /dev/null +++ b/freecad/Curves/resources/translations/Curves_es-ES.ts @@ -0,0 +1,3227 @@ + + + + + App::Property + + + + Edge + Aristas + + + + Tool target + Objetivo de herramienta + + + + Discretization Method + Método de discretización + + + + Number of edge points + Número de puntos de la arista + + + + Distance between edge points + + + + + Distance for deflection Algorithm + + + + + Angular value for Angular-Curvature Algorithm + + + + + Curvature value for Angular-Curvature Algorithm + + + + + Minimum Number of points + + + + + Start parameter + + + + + End parameter + + + + + + + Points + + + + + + Normalized parameters list + + + + + Object on which the analysis is performed + + + + + Anaysis direction + + + + + Positive draft angle + + + + + Negative draft angle + + + + + Positive draft tolerance + + + + + Negative draft tolerance + + + + + Color of the positive in-draft area + + + + + Color of the positive tolerance area + + + + + Color of the positive out-of-draft area + + + + + Color of the negative in-draft area + + + + + Color of the negative tolerance area + + + + + Color of the negative out-of-draft area + + + + + + Amount of shading on the analysis overlay + + + + + + + Input face + + + + + Size of the map in the U direction + + + + + Size of the map in the V direction + + + + + Add the bounding box of the face + + + + + The conical face to flatten + + + + + Unroll the face in place + + + + + Size of the underlying surface + + + + + SourceObjects + + + + + SourceShapes + + + + + Number of orthogonal samples + + + + + Smoothing factor on curve start + + + + + Smoothing factor on curve end + + + + + Projection method (1,2,3,4) + + + + + + 3D tolerance + + + + + + Parametric tolerance + + + + + + Number of turns + + + + + Thread lead (-1 for auto) + + + + + Allow rational bsplines + + + + + Create a solid shape + + + + + IsoCurve parameter + + + + + Number of IsoCurve in U direction + + + + + Number of IsoCurve in V direction + + + + + Number of IsoCurve + + + + + Curve Orientation + + + + + List of edges to join + + + + + Join all the edges of this base object + + + + + + + Tolerance + + + + + Break on sharp corners + + + + + Force connection of edges + + + + + Force closed curve + + + + + Reverse the output curve + + + + + Set the start point of closed curve + + + + + + Source object + + + + + Direction Vector + + + + + Number of samples around object + + + + + Edge 1 + + + + + Edge 2 + + + + + Location on first edge + + + + + + Reverse Edge + + + + + + + + Scale of blend curve + + + + + + + + Continuity + + + + + Location on second edge + + + + + Poles of the Bezier curve + + + + + + + Output type + + + + + Compute scales to get minimal curvature along curve + + + + + Scale (%). 0 for AutoScale + + + + + + + Number of samples + + + + + Number of surface samples + + + + + Surface Comb Orientation + + + + + CombPoints + + + + + Shape of comb plot + + + + + Color of the curvature curve + + + + + Color of the curvature comb + + + + + List of constraint objects + + + + + Plate degree + + + + + Number of iterations + + + + + 2D Tolerance + + + + + 3D Tolerance + + + + + Angular Tolerance + + + + + Curvature Tolerance + + + + + Anisotropie + + + + + Max degree of Bspline approximation + + + + + Max Number of surface segments + + + + + Max Distance to plate surface + + + + + 3D Tolerance of Bspline approximation + + + + + Criterion Order + + + + + Desired continuity of the surface + + + + + Enlarge Coefficient + + + + + First support edge + + + + + Second support edge + + + + + Parameter on first edge + + + + + Parameter on second edge + + + + + Main axis of the sketch + + + + + + + + + + + + + + + + + + + Tooltip + + + + + Individual faces + + + + + View position + + + + + View direction + + + + + Up direction + + + + + Remove duplicate edges + + + + + Number of edge samples + + + + + CleaningTolerance for duplicate detection + + + + + Isoparametric lines + + + + + Outline silhouette lines + + + + + smooth edge of G1-continuity between two surfaces + + + + + sewn edge of CN-continuity on one surface + + + + + sharp edge (of C0-continuity) + + + + + Generate the visible lines, or the hidden lines + + + + + Output on-shape 3D lines + + + + + Track camera movements + + + + + The list of profiles to sweep + + + + + The sweep path + + + + + Face support of the sweep path + + + + + Trim the sweep shape + + + + + Add profiles to the sweep shape + + + + + Number of extra profiles + + + + + Build a smooth top with extra profiles + + + + + Input Sketch + + + + + Additional objects that will be mapped on surface + + + + + Make faces from closed wires + + + + + Add extrusion faces + + + + + Offset distance of mapped sketch + + + + + Extrusion thickness + + + + + Reverse U direction + + + + + Reverse V direction + + + + + Swap U and V directions + + + + + include construction geometry in sketch bounds + + + + + Analysis Direction + + + + + Analysis Mode + + + + + Fix analysis direction to global coordinate system + + + + + Number of stripes (Zebra, Rainbow) + + + + + Relative width of stripes (Zebra) + + + + + First color (Zebra, Rainbow, Isophote) + + + + + Second color (Zebra, Rainbow, Isophote) + + + + + Start angle of the rainbow + + + + + End angle of the rainbow + + + + + Angles of isophote curves + + + + + Angular tolerance of isophote curves + + + + + Birail object + + + + + List of profiles + + + + + Blending method + + + + + Parametrization of interpolating curves + + + + + + + Profile Samples + + + + + Extend to rail limits + + + + + Shape + + + + + Picked point in parametric space of the face (u,v,0) + + + + + Trimming curve + + + + + Trimming Vector + + + + + Trimming direction + + + + + The object that will be truncated or extended + + + + + The planar object that cuts the Source object + + + + + The distance to truncate (if negative) or extend (if positive) + + + + + Refine shape (clean up redundant edges) + + + + + Reverse cutter plane normal + + + + + Object containing the points to approximate + + + + + Clamp endpoints + + + + + Force a closed curve + + + + + + Minimum degree of the curve + + + + + + Maximum degree of the curve + + + + + + Approximation tolerance + + + + + + Desired continuity of the curve + + + + + Approximation method + + + + + + + Parametrization type + + + + + Weight of curve length for smoothing algorithm + + + + + Weight of curve curvature for smoothing algorithm + + + + + Weight of curve torsion for smoothing algorithm + + + + + Index of first point + + + + + Index of last point (-1 to ignore) + + + + + For closed curves, allows to choose the location of the join point + + + + + Use approximation + + + + + Proxy object of the approximation extension + + + + + Faces to join + + + + + Number of samples to generate each surface + + + + + Fuse the 3 solids together + + + + + Continuity order G... with shape 1 + + + + + Continuity order G... with shape 2 + + + + + + Compute scales to get regular poles, or minimal curvature + + + + + + Number of samples for auto scaling + + + + + Scale values along face 1 + + + + + Scale values along face 2 + + + + + + Status of the created shape + + + + + First edge + + + + + Second edge + + + + + + Placement + + + + + Edge Samples + + + + + Untwist surface + + + + + Variable scale 1: list of vectors(parameter, scale1, 0) + + + + + Variable scale 2: list of vectors(parameter, scale2, 0) + + + + + Edges and support faces + + + + + Number of samples to generate surface + + + + + Continuity level with face of edge 1 + + + + + Continuity level with face of edge 2 + + + + + Scale values along edge 1 + + + + + Scale values along edge 2 + + + + + Spring Length + + + + + Diameter of the spring wire + + + + + Diameter of the spring + + + + + Flatness of spring extremities from 0 to 4 + + + + + Output a wire shape + + + + + Left hand if true + + + + + The list of seam edges to check + + + + + Number of test samples on edge + + + + + Number of test lines on each sample + + + + + Continuity tolerance + + + + + Input edge to extend + + + + + + Output shape + + + + + Start Extension Length + + + + + Start Extension type + + + + + End Extension Length + + + + + End Extension type + + + + + Input edge + + + + + Support face + + + + + Reverse tangent + + + + + Reverse normal + + + + + Reverse binormal + + + + + Width of the output face + + + + + Face symmetric across curve + + + + + Close the curve + + + + + Reverse the parametric orientation of the curve + + + + + Curve network + + + + + Max Number of control points + + + + + Number of samples in U direction + + + + + Number of samples in V direction + + + + + Flip surface normal + + + + + Constraint shapes + + + + + Parametrization factor + + + + + Periodic curve + + + + + Data list + + + + + Tangents list + + + + + Tangent flags + + + + + Types of interpolated points + + + + + Linear segment flags + + + + + Size of a grid quadrant + + + + + Size of subdivisions + + + + + XY plane attenuation + + + + + XZ plane attenuation + + + + + YZ plane attenuation + + + + + XY plane max visibility + + + + + XZ plane max visibility + + + + + YZ plane max visibility + + + + + Grid Color + + + + + Source object that provides points to interpolate + + + + + Point list to interpolate + + + + + Set the curve closed + + + + + Interpolation tolerance + + + + + User specified tangents + + + + + interpolate 3 aligned points with a line + + + + + interpolate with a degree 1 polygonal curve + + + + + + Offset the start index of the point list + + + + + outputs a wire or a single edge + + + + + Parameters of interpolated points + + + + + Tangents at interpolated points + + + + + Activation flag of tangents + + + + + Face support of the spiral + + + + + Nb of turns between 2 points, in U direction + + + + + Nb of turns between 2 points, in V direction + + + + + First Vertex + + + + + Second Vertex + + + + + First shape + + + + + Second shape + + + + + Projection direction of the first shape. +If vector is null, shape's placement is used. + + + + + Projection direction of the second shape. +If vector is null, shape's placement is used. + + + + + Build ruled surfaces between Shape1 and resulting Mixed-Curve + + + + + Build ruled surfaces between Shape2 and resulting Mixed-Curve + + + + + Objects to loft + + + + + Ruled Loft + + + + + Close loft + + + + + Max Bspline degree + + + + + List of faces to build the solid + + + + + If the output shape in not a solid, this will output the open edges + + + + + Sweep path + + + + + Profiles that are swept along spine + + + + + Shape of the ShapeSupport mode + + + + + Auxiliary spine + + + + + PipeShell mode + + + + + Make solid object + + + + + Maximum degree of the generated surface + + + + + Maximum number of segments of the generated surface + + + + + Number of samples for preview + + + + + Tolerance 3D + + + + + Tolerance boundary + + + + + Tolerance angular + + + + + Direction of the Binormal and FixedTrihedron modes + + + + + Location of the FixedTrihedron mode + + + + + Corrected Frenet + + + + + Curvilinear equivalence + + + + + Type of contact to auxiliary spine + + + + + + SubShapes of the profile + + + + + source object of the profile + + + + + + + + Vertex location on spine + + + + + Translate profile to contact spine + + + + + Rotate profile to be orthogonal to spine + + + + + Initial Face + + + + + Option list + + + + + Segmenting direction + + + + + Splitting parameters in U direction + + + + + Splitting parameters in V direction + + + + + Split the U parameter range in the given number of segments + + + + + Split the V parameter range in the given number of segments + + + + + Object generating normalized parameters in U direction + + + + + Object generating normalized parameters in V direction + + + + + Edge to split + + + + + List of splitting locations +% and units are allowed +Negative values are computed from edge end + + + + + Number of equal segments + + + + + List of objects that cut the curve + + + + + Create a split point at nearest of each vertex of the cutting objects + + + + + Expression-ready distance value + + + + + Rebuild and output the complete shape + + + + + CurveEditor + + + Curve Editor + Editor de curva + + + + Curve Type : + Tipo de curva: + + + + Bezier + Bezier + + + + Degree + Grado + + + + OK + Aceptar + + + + Cancel + Cancelar + + + + Curves_AdjacentFaces + + + Select Adjacent faces + Seleccionar caras adyacentes + + + + Select the Adjacent faces of the selected subshape + Seleccionar las caras adyacentes de la subforma seleccionada + + + + Select a face or an edge in the 3D View, activate tool +and all the faces that touch it will be added to the selection. + Seleccione una cara o una arista en la vista 3D, active la herramienta +y todas las caras que la toquen serán agregadas a la selección. + + + + Usage + Uso + + + + Curves_Approximate + + + Approximate + Aproximar + + + + Approximate points to NURBS curve or surface + Aproximar puntos a curva NURBS o superficie + + + + Curves_BlendSolid + + + BlendSolid + Fusionar sólido + + + + Create a solid between two faces with some continuity with their support shapes + Crear un sólido entre dos caras con alguna continuidad con sus formas de soporte + + + + Select a face on each of the two solids to blend, in the 3D View. + Seleccione una cara en cada uno de los dos sólidos a unir, en la vista 3D. + + + + Usage + Uso + + + + Curves_BlendSurf2 + + + BlendSurface + Fusionar superficie + + + + Create a surface between two edges with some continuity with their support faces + Crear una superficie entre dos aristas con alguna continuidad con sus caras de soporte + + + + You must select 4 subshapes in the 3D View : +- EDGE1 on FACE1 +- EDGE2 on FACE2 + Debe seleccionar 4 subformas en la vista 3D: +- ARISTA1 en CARA1 +- ARISTA2 en CARA2 + + + + Usage + Uso + + + + Curves_BsplineToConsole + + BSpline to console + BSpline a consola + + + + Creates a python script to build the selected BSpline or Bezier geometries. + Crear un script de Python para crear las geometrías BSpline o Bezier seleccionadas. + + + + Select some Bezier or BSpline curves or surfaces in the 3D View and activate the tool. +The selected curves or surfaces will be re-created with commands in the python console. + Seleccione algunas curvas BSpline o Bezier o superficies en la vista 3D y active la herramienta. +Las curvas o superficies seleccionadas serán recreadas con comandos en la consola de Python. + + + + BSpline to Console + BSpline a consola + + + + Usage + Uso + + + + Curves_CompressionSpring + + + Compression Spring + Resorte de compresión + + + + Parametric Compression Spring + Resorte de compresión paramétrico + + + + Curves_CurveOnSurface + + + CurveOnSurface + Curva en superficie + + + + Create a curve on surface object + Crear una curva en un objeto superficie + + + + Curves_Discretize + + + Discretize + Discretizar + + + + Discretize an edge or a wire. + Discretizaruna arista o un alambre. + + + + Select an edge in the 3D View +Activate tool +It will generate some points along the edge, following various methods + Seleccione una arista en la vista 3D +Active la herramienta +Generará algunos puntos a lo largo de la arista, siguiendo varios métodos + + + + Usage + Uso + + + + Curves_DraftAnalysis + + + Draft Analysis + Análisis de calado + + + + Create a colored overlay on an object to visualize draft angles. +Tool options are in the View tab. +Mouse clics in the colored areas print measured draft angle in the Report View. + Crea una superposición de colores sobre un objeto para visualizar los ángulos de calado. +Las opciones de la herramienta se encuentran en la pestaña Vista. +Los clics del ratón en las áreas coloreadas imprimen el ángulo de calado medido en la vista de informe. + + + + Curves_EditableSpline + + + Freehand BSpline + BSpline a mano alzada + + + + Creates an freehand BSpline curve + Crear una curva BSpline a mano alzada + + + + *** Interpolation curve control keys : + + a - Select all / Deselect + i - Insert point in selected segments + t - Set / unset tangent (view direction) + p - Align selected objects + s - Snap points on shape / Unsnap + l - Set/unset a linear interpolation + x,y,z - Axis constraints during grab + q - Apply changes and quit editing + *** Teclas de control de la curva de interpolación: + + a - Seleccionar/Deselecciionar todo + i - Insertar punto en segmentos seleccionados + t - Establecer tangente (dirección de vista) + p - Alinear los objetos seleccionados + s - Ajustar puntos en forma + l - Establecer una interpolación lineal + x,y,z - Restricciones de eje x, y, z durante el agarre + q - Aplicar cambios y dejar de editar + + + + Usage + Uso + + + + Curves_ExtendCurve + + + Curve extend + Extensión de curva + + + + Extend an edge by a given distance. + Extender una arista por una distancia dada. + + + + Select an edge in the 3D View, and activate tool. +Edge can be extended at each end, by a given distance. + Seleccione una arista en la vista 3D y active la herramienta. +La arista puede ser extendida en cada extremo, por una distancia dada. + + + + Usage + Uso + + + + Curves_ExtractSubshape + + + Extract subshape + Extraer subforma + + + + Make a non-parametric copy of selected subshapes. +Same as Part_ElementCopy + Crear una copia no paramétrica de las subformas seleccionadas. +Al igual que Part_ElementCopy + + + + Curves_FlattenFace + + + Flatten face + Aplanar cara + + + + Creates a flat developed face from conical and cylindrical faces + Crear una cara desarrollada plana desde caras cónicas y cilíndricas + + + + You must select a conical or cylindrical face in the 3D View. +InPlace property puts the unrolled face tangent to the source face (InPlace = True) +or in the XY plane (InPlace = False) + Debe seleccionar una cara cónica o cilíndrica en la vista 3D. +La propiedad InPlace pone la cara desenrrollada tangente a la cara de la superficie (InPlace = Verdadero) +o en el plano XY (InPlace = Falso) + + + + Usage + Uso + + + + Curves_GeometryInfo + + + GeomInfo + Información de geometría + + + + Display geometry information about selected shape + Mostrar información de geometría de la forma seleccionada + + + + While active, this tool displays information about the geometry of an edge or face. +It displays poles, knots and weights of Bezier and BSpline curves and surfaces in the 3D View. + Mientras este activo, esta herramienta muestra información acerca de la geometría de una arista o cara. +Muestra los polos, nudos y pesos de las curvas Bezier y BSpline y superficies en la vista 3D. + + + + Curves_GordonSurface + + + Parametric Gordon surface + Superficie de Gordon paramétrica + + + + Creates a surface that skins a network of curves. + Crea una superficie que recubre una red de curvas. + + + + Curves_Interpolate + + + Interpolate + Interpolar + + + + Interpolate a set of points. + Interpolar un conjunto de puntos. + + + + Curves_IsoCurve + + + IsoCurve + IsoCurva + + + + IsoCurve: Create an IsoCurve from a face + Crea una isocurva a partir de una cara + + + + Curves_JoinCurve + + + joinCurves + Unir curvas + + + + Joins the selected edges into a BSpline Curve + Unir las aristas seleccionadas en una curva BSpline + + + + Select the edges to join in the 3D View, or select an object containing multiple edges in the Tree View. +Activate the tool. +The output is a single BSpline curve joining all selected edges. + Seleccione las aristas a unir en la vista 3D, o seleccione un objeto que contenga varias aristas en la vista 3D. +Active la herramienta. +La salida es una única curva BSpline que une todas las aristas seleccionadas. + + + + Usage + Uso + + + + Curves_Line + + + Parametric line + Línea paramétrica + + + + Parametric line between two vertexes. + Línea paramétrica entre dos vértices. + + + + Select 2 vertexes in the 3D View and activate the tool. + Selecciones 2 vértices en la vista 3D y active la herramienta. + + + + Usage + Uso + + + + Curves_MixedCurve + + + Mixed curve + Curva mixta + + + + Builds a 3D curve as the intersection of 2 projected curves. + Construir una curva 3D como la intersección de 2 curvas proyectadas. + + + + Select two objects or shapes, and activate tool. +The camera direction is saved during each shape selection, and will be used as projection direction. +Set these directions to (0,0,0) to use the placement of each shape as projection direction. + Seleccione dos objetos o formas y active la herramienta. +La dirección de la cámara es guardada durante cada selección de forma, y será usada como dirección de proyección. +Establezca estas direcciones a (0,0,0) para usar la ubicación de cada forma como dirección de proyección. + + + + Usage + Uso + + + + Curves_MultiLoft + + + MultiLoft + Proyección múltiple + + + + Loft profile objects made of multiple faces in parallel + Objetos de perfil de proyección formados por varias caras en paralelo + + + + Curves_ObjectsToConsole + + + Objects to Console + Objetos a consola + + + + Give access to the selected objects in the python console. + Dar acceso a los objetos seleccionados en la consola de Python. + + + + Select some objects in the TreeView, or in the 3D View, and activate tool. +Some variables will be created in the python console, to access the selection. + Seleccione algunos objetos en la vista de árbol o en la vista 3D y active la herramienta. +Algunas variables serán creadas en la consola de Python, para acceder a la selección. + + + + Usage + Uso + + + + Curves_ParametricBlendCurve + + + Blend curve + Fusionar curva + + + + Blend curve between two edges. Double-clic object to enable/disable freehand mouse editing. + Fusionar curva entre dos aristas. Dé doble clic en el objeto al cual habilitar/deshabilitar edición con ratón a mano alzada. + + + + Curves_ParametricComb + + + Comb plot + Gráfico de peine + + + + Creates a parametric Comb plot on selected edges + Crear un gráfico de peine paramétrico en las aristas seleccionadas + + + + Curves_ParametricSolid + + + Parametric solid + Sólido paramétrico + + + + Make a parametric solid from selected faces. + Crear un sólido paramétrico desde las caras seleccionadas. + + + + Select some faces in the 3D View, or select objects in the Tree View. +Activate tool. +It will try to build a solid from selected faces. +If not possible, it falls back to a shell, then to a compound. +The ShapeStatus property (and the color of the icon) give the type of shape. + Seleccione algunas caras en la vista 3D, o seleccione objetos en la vista de árbol. +Active herramienta. +Intentará construir un sólido a partir de caras seleccionadas. +Si no es posible, intenta un cascarón,sino a un compuesto. +La propiedad ShapeStatus (y el color del icono) dan el tipo de forma. + + + + Usage + Uso + + + + Curves_PasteSVG + + + Paste SVG + Pegar SVG + + + + Paste the SVG content of the clipboard + Pegar el contenido SVG del portapapeles + + + + When working in parallel with FreeCAD and a SVG editor (Inkscape), +copy (CTRL-C) an object in the SVG editor, switch to FreeCAD and activate tool. +This will import the SVG content of the clipboard into the active FreeCAD document. + Cuando trabaja en paralelo con FreeCAD y un editor de SVG (Inkscape), +copie (CTRL-C) un objeto en el editor SVG, cambie a FreeCAD y active la herramienta. +Esto importará el contenido SVG del portapapeles en el documento activo de FreeCAD. + + + + Usage + Uso + + + + Curves_Pipeshell + + + Pipeshell + Cascarón de tubería + + + + Creates a PipeShell sweep object + Crea un objeto de barrido de cascarón de tubería + + + + Curves_PipeshellProfile + + + Pipeshell profile + Perfil de cascarón de tubería + + + + Creates a Profile object for PipeShell + Crea un objeto de perfil para cascarón de tubería + + + + Curves_ProfileSupport + + + Profile Support + Soporte de perfil + + + + Creates a support shape between two rails + Crea una forma de soporte entre dos rieles + + + + Curves_ProfileSupportPlane + + + Profile support plane + Plano de soporte de perfil + + + + Creates a support plane for sketches + Crea un plano de soporte para los croquis + + + + Curves_ReflectLines + + + Reflect Lines + Líneas de reflejo + + + + Creates the reflect lines on a shape, according to a view direction + Crear las líneas de reflejo en la forma, de acuerdo a una dirección de vista + + + + Select an object and activate tool. +This will create reflect lines according to the current view direction. +If selected object is a ReflectLines object, the view direction will be updated to the current camera direction. +If property OnShape is True, the lines will be ON the input shape (ViewPos and UpDir properties won't be used). +Otherwise, lines will be on the XY plane. +If view property TrackCam is True, the view direction will keep updating upon camera movements. + + Seleccione un objeto y active la herramienta. +Esto creará líneas de reflejo de acuerdo con la dirección de vista actual. +Si el objeto seleccionado es un objeto ReflectLines, la dirección de vista se actualizará a la dirección de la cámara actual. +Si la propiedad Onshape es verdadera, las líneas estarán en la forma de entrada (no se utilizarán las propiedades de ViewPos y UpDir). +De lo contrario, las líneas estarán en el plano XY. +Si la propiedad de vista TrackCam es verdadera, la dirección de la vista se actualizará sobre los movimientos de la cámara. + + + + + Usage + Uso + + + + Curves_RotationSweep + + + Rotation Sweep + Barrido de rotación + + + + Sweep some profiles along a path, and around a point + Barrer algunos perfiles a lo largo de una trayectoria, y alrededor de un punto + + + + Select a sweep path and some profiles in the 3D View. +If TrimPath is False, the Sweep surface will be extrapolated to fit the whole path. + Seleccione una trayectoria de barrido y algunos perfiles en la vista 3D. +Si TrimPath es falso, la superficie de barrido será extrapolada para abarcar toda la trayectoria. + + + + Usage + Uso + + + + Curves_SegmentSurface + + + Segment surface + Segmentar superficie + + + + Segment a surface on isocurves + Segmento a superficie en isocurvas + + + + Select a face in the 3D view and activate tool. +The face will be converted to a BSpline surface. +In Auto mode, the surface will be segmented along isocurves of highest multiplicity. +In Custom mode, it will be segmented along isocurves of specified parameters. +These parameters can be provided by an external object that have a NormalizedParameters property, +like the Discretize, or the SplitCurve tools. + Seleccione una cara en la vista 3D y active la herramienta. +La cara se convertirá en una superficie de BSpline. +En modo automático, la superficie se segmentará a lo largo de isocurvas con la mayor multiplicidad. +En modo personalizado, se segmentará a lo largo de isocurvas de parámetros especificados. +Estos parámetros pueden ser proporcionados por un objeto externo que tenga una propiedad NormalizedParameters, +como Discretize o las herramientas SplitCurve. + + + + Usage + Uso + + + + Curves_SketchOnSurface + + + Sketch on surface + Croquis en superficie + + + + Map a sketch on a surface + Mapear un croquis a una superficie + + + + Curves_SplitCurve + + + Split curve + Dividir curva + + + + Splits the selected edge + Dividir la arista seleccionada + + + + Select an edge in the 3D View, or an object containing a wire in the Tree View +Activate Tool +The selected edges (or wire) will be cut at the specified location. +The split locations can be given as real edge parameter, absolute distance(mm) or relative distance (%) +The split locations can be set by proximity to cutting objects. +Double-click in Tree-View to toggle Freehand editor in 3D View. + + Seleccione una arista en la vista 3D, o un objeto que contenga un alambre en la vista de árbol +Active la herramienta +Las aristas seleccionadas (o alambre) será cortado en la ubiación especificada. +Las ubicaciones divididas se pueden dar como parámetro de arista real, distancia absoluta (mm) o distancia relativa (%) +Las ubicaciones divididas se pueden establecer por proximidad a los objetos de corte. +Haga doble clic en la vista de árbol para alternar al editor a mano alzada en la vista 3D. + + + + + Usage + Uso + + + + Curves_SurfaceAnalysis + + + Surface Analysis + Análisis de superficie + + + + Doc + Doc + + + + Curves_SweepToRails + + + Sweep2Rails + Barrido a rieles + + + + Sweep profiles on 2 rails + Barre perfiles en rieles + + + + Curves_Trim + + + Trim face + Recortar cara + + + + Trim a face with a projected curve + Recortar una cara con una curva proyectada + + + + Curves_TruncateExtendCmd + + + Truncate Extend + Extensión truncada + + + + Cut a shape with a plane and truncate or extend it by a given distance. +In a PartDesign body, select only the cutting plane. +Otherwise, select the shape to modify, and the cutting plane. + Corta una forma con un plano y lo trunca o lo extiende por una distancia dada. +En un cuerpo de PartDesign, seleccione solo el plano de corte. +De lo contrario, seleccione la forma a modificar y el plano de corte. + + + + Curves_ZebraTool + + + ZebraTool + Herramienta cebra + + + + Zebra texture for surface inspection + Textura de cebra para inspección de superficie + + + + Log + + + + + +BSplineCurve + + + + + + + Degree: {} + + Grado: {} + + + + + + NbPoles: {} + + + + + + + Knots: {} ({:0.2f} - {:0.2f}) + + + + + + + Mults: {} + + + + + + + Periodic: {} + + + + + + + + +BSplineSurface +************ + + + + + + + + + Failed to compute uIso curve + + + + + + + + + Failed to compute vIso curve + + + + + + + + ************ + + + + + + + + {} + + {} + + + + + + + + + Error in onDelete: {0} + + Error en onDelete: {0} + + + + + + + + + + + + + + + + {} : +{} + + + + + + InterpolationPolygon : bad input + + + + + + + + + + Select something first ! + + + + + + Bad input :{}-{} + + + + + + + + + + + + + + + + + + + BlendCurve: Install 'scipy' python package for AutoScale feature + + + + + + + pointEditor : bad input + + + + + --- Entering Comb Edit Mode --- + + + + + + Nb of samples : CTRL + Mouse Up / Down + + + + + + Comb scale : SHIFT + Mouse Up / Down + + + + + + --- Exiting Comb Edit Mode --- + + + + + + Periodic interpolation + + + + + + Ignoring duplicate last point + + + + + + Duplicates point list + + + + + + Parameters are not increasing + + + + + + Falling back to ChordLength + + + + + + + Select 2 edges or vertexes first ! + + + + + + Select 2 rail objects, and optionally some profile objects + + + + + + Select an object first ! + + + + + + Sketch on surface : failed to create solid # {}. + + + + + + Please select a face (in the 3D view) or a sketch + + + + + + Select a ruled surface and a list of profile edges + + + + + + Select 2 rails and at least 2 profiles + + + + + + Failed importing BOPTools. Fallback to Part API + + + + + + Wrong Selection + + + + + + Zebra already active + + + + + + CurvesWB._utils.getShape: wrong property type. + + + + + + +Please select an object that has at least 2 vertexes + + + + + BlendSolid : The two faces must have the same number of edges + + + + + + BlendSurface : failed to compute scale +{} + + + + + + Select 2 CurveOnSurface objects. + + + + + + + + failed to extract 2D geometry + + + + + Segmenting input curve + + + + + + Select the edges to extend first ! + + + + + + Curve_on_surface.get_cross_curve : parameter out of range + + + + + + {} is not in [{},{}] + + + + + + {} - {} + + + + + + + Select an edge and its supporting face + + + + + + --- + + + + + + + + exchange UV + + + + + + reverse U + + + + + + reverse V + + + + + + Inserting flat profile at 0.0 + + + + + + Inserting flat profile at 1.0 + + + + + + Select a curve network ! + + + + + + Gordon Profile : Data and DataType mismatch + + + + + + execute is disabled during editing + + + + + + {} : Not enough points + + + + + + + Error. Not a face + + + + + Direction error + + + + + Parameter error + + + + + + No intersection points + + + + + + {} broken ! + + + + + + Projection: several pcurves + + + + + pcurve should be closed + + + + + Select 2 objects ! + + + + + + + + U degree mismatch error + + + + + + + + V degree mismatch error + + + + + + + U parameter ranges mismatch error + + + + + + + V parameter ranges mismatch error + + + + + + U KnotSequence mismatch error + + + + + + V KnotSequence mismatch error + + + + + + EdgeInterpolator input must be edge or wire + + + + + Bad type of data + + + + + Argument must be list or tuple + + + + + +Sorry, ContactOnBorder option is currently broken in OCCT. + + + + + + +Wrong direction, defaulting to +Z + + + + + + +Direction has null length, defaulting to +Z + + + + + + +Please set a valid Auxiliary Spine Object + + + + + + +Please set a valid Spine support Object + + + + + + +Failed to create shape + + + + + + +You must select: +- in the 3D view, the edges that build the sweep path +- in the Tree view, one or more 'pipeshellProfile' objects + + + + + + +Failed to build wire + + + + + + +Failed to extract edges + + + + + + Select at least 1 edge ! + + + + + + InterpoCurveEditor : bad input + + + + + Snapped to {} + + + + + + Snapped to Vertex + + + + + + Snapped to Edge + + + + + + Snapped to Face + + + + + + Not snapped + + + + + + Subdividing line #{} + + + + + + VPEditor has no widget ! + + + + + + VPEditor.Quit() + + + + + + Failed to remove from ComboView + + + + + + SplitCurve : Input shape has no wires or edges + + + + + + Split curve : failed to build temp Wire ! + + + + + Split curve : Invalid Wire ! + + + + + Nothing selected ! + + ¡No hay nada seleccionado! + + + + + This property accept only 1 subobject ! + + ¡Esta propiedad sólo acepta 1 subobjeto! + + + + + Select 1 object ! + + ¡Seleccione 1 objeto! + + + + + Workbench + + + + + + + Curves + Curvas + + + + a workbench dedicated to curves and surfaces + Un banco de trabajo dedicado a curvas y superficies + + + + + Surfaces + Superficies + + + + + Misc. + Misc. + + + + Zebra + + + Zebra Stripes Tool + Herramienta de rayas de cebra + + + + Black Stripes Width + Ancho de rayas negras + + + + Scale + Escala + + + + Rotation + Rotación + + + + Quit + Salir + + +