From 0b14e8e24b56bdf9050920806e8da4b1cbbb129f Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Mon, 29 Sep 2025 10:48:01 -0500 Subject: [PATCH] Assembly: Fix translatable strings (#24243) * Assembly: Fix translatable strings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/Mod/Assembly/CommandCreateBom.py | 20 +-- src/Mod/Assembly/CommandCreateJoint.py | 152 ++++++-------------- src/Mod/Assembly/CommandCreateSimulation.py | 6 +- src/Mod/Assembly/CommandCreateView.py | 6 +- src/Mod/Assembly/CommandInsertLink.py | 24 ++-- src/Mod/Assembly/CommandInsertNewPart.py | 6 +- src/Mod/Assembly/CommandSolveAssembly.py | 6 +- 7 files changed, 68 insertions(+), 152 deletions(-) diff --git a/src/Mod/Assembly/CommandCreateBom.py b/src/Mod/Assembly/CommandCreateBom.py index 1220eea656..a84354dd00 100644 --- a/src/Mod/Assembly/CommandCreateBom.py +++ b/src/Mod/Assembly/CommandCreateBom.py @@ -68,22 +68,12 @@ class CommandCreateBom: "Pixmap": "Assembly_BillOfMaterials", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateBom", "Bill of Materials"), "Accel": "O", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateBom", - "Creates a bill of materials of the current assembly. If an assembly is active, it will be a BOM of this assembly. Else it will be a BOM of the whole document.", - ) - + "

" - + QT_TRANSLATE_NOOP( - "Assembly_CreateBom", - "The BOM object is a document object that stores the settings of your BOM. It is also a spreadsheet object so you can easily visualize the BOM. If you do not need the BOM object to be saved as a document object, you can simply export and cancel the task.", - ) - + "

" - + QT_TRANSLATE_NOOP( - "Assembly_CreateBom", - "The columns 'Index', 'Name', 'File Name' and 'Quantity' are automatically generated on recompute. The 'Description' and custom columns are not overwritten.", - ) - + "

", + "

Creates a bill of materials of the current assembly. If an assembly is active, it will be a BOM of this assembly. Else it will be a BOM of the whole document.

" + "

The BOM object is a document object that stores the settings of your BOM. It is also a spreadsheet object so you can easily visualize the BOM. If you do not need the BOM object to be saved as a document object, you can simply export and cancel the task.

" + "

The columns 'Index', 'Name', 'File Name' and 'Quantity' are automatically generated on recompute. The 'Description' and custom columns are not overwritten.

", + ), "CmdType": "ForEdit", } diff --git a/src/Mod/Assembly/CommandCreateJoint.py b/src/Mod/Assembly/CommandCreateJoint.py index 1d9346e536..8d4016d41a 100644 --- a/src/Mod/Assembly/CommandCreateJoint.py +++ b/src/Mod/Assembly/CommandCreateJoint.py @@ -76,18 +76,11 @@ class CommandCreateJointFixed: "Fixed Joint", ), "Accel": "F", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointFixed", - "1 - If an assembly is active : Creates a joint permanently locking two parts together, preventing any movement or rotation", - ) - + "

" - + "

" - + QT_TRANSLATE_NOOP( - "Assembly_CreateJointFixed", - "2 - If a part is active: Positions sub-parts by matching selected coordinate systems. The second part selected will move.", - ) - + "

", + "

1 - If an assembly is active : Creates a joint permanently locking two parts together, preventing any movement or rotation

" + "

2 - If a part is active: Positions sub-parts by matching selected coordinate systems. The second part selected will move.

", + ), "CmdType": "ForEdit", } @@ -110,12 +103,10 @@ class CommandCreateJointRevolute: "Pixmap": "Assembly_CreateJointRevolute", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointRevolute", "Revolute Joint"), "Accel": "R", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointRevolute", "Creates a revolute joint allowing rotation around a single axis between selected parts", - ) - + "

", + ), "CmdType": "ForEdit", } @@ -135,12 +126,10 @@ class CommandCreateJointCylindrical: "Pixmap": "Assembly_CreateJointCylindrical", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointCylindrical", "Cylindrical Joint"), "Accel": "C", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointCylindrical", "Creates a cylindrical joint that allows rotation around and translation along a single axis between assembled parts", - ) - + "

", + ), "CmdType": "ForEdit", } @@ -160,12 +149,10 @@ class CommandCreateJointSlider: "Pixmap": "Assembly_CreateJointSlider", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointSlider", "Slider Joint"), "Accel": "S", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointSlider", "Creates a slider joint that allows linear movement along a single axis, but restricts rotation between selected parts", - ) - + "

", + ), "CmdType": "ForEdit", } @@ -185,12 +172,10 @@ class CommandCreateJointBall: "Pixmap": "Assembly_CreateJointBall", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointBall", "Ball Joint"), "Accel": "B", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointBall", "Creates a ball joint that connects parts at a point, allowing unrestricted movement as long as the connection points remain in contact", - ) - + "

", + ), "CmdType": "ForEdit", } @@ -210,18 +195,12 @@ class CommandCreateJointDistance: "Pixmap": "Assembly_CreateJointDistance", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointDistance", "Distance Joint"), "Accel": "D", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointDistance", - "Creates a distance joint that fixes the distance between the selected objects", - ) - + "

" - + QT_TRANSLATE_NOOP( - "Assembly_CreateJointDistance", - "Creates one of several different joints based on the selection" - "For example, a distance of 0 between a plane and a cylinder creates a tangent joint. A distance of 0 between planes will make them co-planar.", - ) - + "

", + "

Creates a distance joint that fixes the distance between the selected objects

" + "

Creates one of several different joints based on the selection. " + "For example, a distance of 0 between a plane and a cylinder creates a tangent joint. A distance of 0 between planes will make them co-planar.

", + ), "CmdType": "ForEdit", } @@ -241,12 +220,10 @@ class CommandCreateJointParallel: "Pixmap": "Assembly_CreateJointParallel", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointParallel", "Parallel Joint"), "Accel": "N", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointParallel", "Creates a parallel joint that makes the Z-axis of the selected coordinate systems parallel", - ) - + "

", + ), "CmdType": "ForEdit", } @@ -268,12 +245,10 @@ class CommandCreateJointPerpendicular: "Assembly_CreateJointPerpendicular", "Perpendicular Joint" ), "Accel": "M", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointPerpendicular", "Creates a perpendicular joint that makes the Z-axis of the selected coordinate systems perpendicular", - ) - + "

", + ), "CmdType": "ForEdit", } @@ -293,12 +268,10 @@ class CommandCreateJointAngle: "Pixmap": "Assembly_CreateJointAngle", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointAngle", "Angle Joint"), "Accel": "X", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointAngle", "Creates an angle joint that fixes the angle between the Z-axis of the selected coordinate systems", - ) - + "

", + ), "CmdType": "ForEdit", } @@ -320,17 +293,11 @@ class CommandCreateJointRackPinion: "Assembly_CreateJointRackPinion", "Rack and Pinion Joint" ), "Accel": "Q", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointRackPinion", - "Creates a rack and pinion joint that links a part with a sliding joint to a part with a revolute joint", - ) - + "

" - + QT_TRANSLATE_NOOP( - "Assembly_CreateJointRackPinion", - "Selects the same coordinate systems as the revolute and sliding joints. The pitch radius defines the movement ratio between the rack and the pinion.", - ) - + "

", + "

Creates a rack and pinion joint that links a part with a sliding joint to a part with a revolute joint

" + "

Selects the same coordinate systems as the revolute and sliding joints. The pitch radius defines the movement ratio between the rack and the pinion.

", + ), "CmdType": "ForEdit", } @@ -350,17 +317,11 @@ class CommandCreateJointScrew: "Pixmap": "Assembly_CreateJointScrew", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointScrew", "Screw Joint"), "Accel": "W", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointScrew", - "Creates a screw joint that links a part with a sliding joint to a part with a revolute joint", - ) - + "

" - + QT_TRANSLATE_NOOP( - "Assembly_CreateJointScrew", - "Select the same coordinate systems as the revolute and sliding joints. The pitch radius defines the movement ratio between the rotating screw and the sliding part.", - ) - + "

", + "

Creates a screw joint that links a part with a sliding joint to a part with a revolute joint

" + "

Select the same coordinate systems as the revolute and sliding joints. The pitch radius defines the movement ratio between the rotating screw and the sliding part.

", + ), "CmdType": "ForEdit", } @@ -380,17 +341,11 @@ class CommandCreateJointGears: "Pixmap": "Assembly_CreateJointGears", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointGears", "Gears Joint"), "Accel": "T", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointGears", - "Creates a gears joint that links 2 rotating gears together. They will have inverse rotation direction.", - ) - + "

" - + QT_TRANSLATE_NOOP( - "Assembly_CreateJointScrew", - "Select the same coordinate systems as the revolute joints.", - ) - + "

", + "

Creates a gears joint that links 2 rotating gears together. They will have inverse rotation direction.

" + "

Select the same coordinate systems as the revolute joints.

", + ), "CmdType": "ForEdit", } @@ -410,17 +365,11 @@ class CommandCreateJointBelt: "Pixmap": "Assembly_CreateJointPulleys", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointBelt", "Belt Joint"), "Accel": "L", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointBelt", - "Creates a belt joint that links 2 rotating objects together. They will have the same rotation direction.", - ) - + "

" - + QT_TRANSLATE_NOOP( - "Assembly_CreateJointScrew", - "Select the same coordinate systems as the revolute joints.", - ) - + "

", + "

Creates a belt joint that links 2 rotating objects together. They will have the same rotation direction.

" + "

Select the same coordinate systems as the revolute joints.

", + ), "CmdType": "ForEdit", } @@ -440,17 +389,11 @@ class CommandGroupGearBelt: return { "Pixmap": "Assembly_CreateJointGears", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointGearBelt", "Gears/Belt Joint"), - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateJointGearBelt", - "Creates a gears or belt joint that links 2 rotating gears together", - ) - + "

" - + QT_TRANSLATE_NOOP( - "Assembly_CreateJointGearBelt", - "Select the same coordinate systems as the revolute joints.", - ) - + "

", + "

Creates a gears or belt joint that links 2 rotating gears together

" + "

Select the same coordinate systems as the revolute joints.

", + ), "CmdType": "ForEdit", } @@ -485,12 +428,11 @@ class CommandToggleGrounded: "Pixmap": "Assembly_ToggleGrounded", "MenuText": QT_TRANSLATE_NOOP("Assembly_ToggleGrounded", "Toggle Grounded"), "Accel": "G", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_ToggleGrounded", - "Toggles the grounding of a part.\nGrounding a part permanently locks its position in the assembly, preventing any movement or rotation. You need at least one grounded part before starting to assemble.", - ) - + "

", + "

Toggles the grounding of a part.

" + "

Grounding a part permanently locks its position in the assembly, preventing any movement or rotation. You need at least one grounded part before starting to assemble.", + ), "CmdType": "ForEdit", } diff --git a/src/Mod/Assembly/CommandCreateSimulation.py b/src/Mod/Assembly/CommandCreateSimulation.py index 3b7a699e79..9f69c9b85f 100644 --- a/src/Mod/Assembly/CommandCreateSimulation.py +++ b/src/Mod/Assembly/CommandCreateSimulation.py @@ -66,12 +66,10 @@ class CommandCreateSimulation: "Pixmap": "Assembly_CreateSimulation", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateSimulation", "Simulation"), "Accel": "V", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateSimulation", "Creates a new simulation of the current assembly", - ) - + "

", + ), "CmdType": "ForEdit", } diff --git a/src/Mod/Assembly/CommandCreateView.py b/src/Mod/Assembly/CommandCreateView.py index d25ff71141..22797f28a0 100644 --- a/src/Mod/Assembly/CommandCreateView.py +++ b/src/Mod/Assembly/CommandCreateView.py @@ -53,12 +53,10 @@ class CommandCreateView: "Pixmap": "Assembly_ExplodedView", "MenuText": QT_TRANSLATE_NOOP("Assembly_CreateView", "Exploded View"), "Accel": "E", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_CreateView", "Creates an exploded view of the current assembly", - ) - + "

", + ), "CmdType": "ForEdit", } diff --git a/src/Mod/Assembly/CommandInsertLink.py b/src/Mod/Assembly/CommandInsertLink.py index 46d160acf1..dd614a5a8e 100644 --- a/src/Mod/Assembly/CommandInsertLink.py +++ b/src/Mod/Assembly/CommandInsertLink.py @@ -42,22 +42,14 @@ __author__ = "Ondsel" __url__ = "https://www.freecad.org" -tooltip = ( - "

" - + QT_TRANSLATE_NOOP( - "Assembly_InsertLink", - "Inserts a component into the active assembly. This will create dynamic links to parts, bodies, primitives, and assemblies. To insert external components, make sure that the file is open in the current session", - ) - + "

" +tooltip = QT_TRANSLATE_NOOP( + "Assembly_InsertLink", + "

Inserts a component into the active assembly. This will create dynamic links to parts, bodies, primitives, and assemblies. To insert external components, make sure that the file is open in the current session

" + "", ) diff --git a/src/Mod/Assembly/CommandInsertNewPart.py b/src/Mod/Assembly/CommandInsertNewPart.py index 212c887832..0d1963cdf0 100644 --- a/src/Mod/Assembly/CommandInsertNewPart.py +++ b/src/Mod/Assembly/CommandInsertNewPart.py @@ -53,12 +53,10 @@ class CommandInsertNewPart: "Pixmap": "Geofeaturegroup", "MenuText": QT_TRANSLATE_NOOP("Assembly_InsertNewPart", "New Part"), "Accel": "P", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_InsertNewPart", "Insert a new part into the active assembly. The new part's origin can be positioned in the assembly.", - ) - + "

", + ), "CmdType": "ForEdit", } diff --git a/src/Mod/Assembly/CommandSolveAssembly.py b/src/Mod/Assembly/CommandSolveAssembly.py index 4622655ead..7ab1fe8b4a 100644 --- a/src/Mod/Assembly/CommandSolveAssembly.py +++ b/src/Mod/Assembly/CommandSolveAssembly.py @@ -49,12 +49,10 @@ class CommandSolveAssembly: "Pixmap": "Assembly_SolveAssembly", "MenuText": QT_TRANSLATE_NOOP("Assembly_SolveAssembly", "Solve Assembly"), "Accel": "Z", - "ToolTip": "

" - + QT_TRANSLATE_NOOP( + "ToolTip": QT_TRANSLATE_NOOP( "Assembly_SolveAssembly", "Solves the currently active assembly.", - ) - + "

", + ), "CmdType": "ForEdit", }