From 7542673b00997a32692a3b80cbcc4430e5eb7899 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Tue, 2 Nov 2021 17:26:35 +0100 Subject: [PATCH] FEM: command module, fix regression in the regard of translation added with 5b52840ca5fdbb --- src/Mod/Fem/femcommands/commands.py | 432 ++++++++++++++++++++++------ 1 file changed, 341 insertions(+), 91 deletions(-) diff --git a/src/Mod/Fem/femcommands/commands.py b/src/Mod/Fem/femcommands/commands.py index 782fffc61f..051be66cb3 100644 --- a/src/Mod/Fem/femcommands/commands.py +++ b/src/Mod/Fem/femcommands/commands.py @@ -31,17 +31,21 @@ __url__ = "https://www.freecadweb.org" import FreeCAD import FreeCADGui +from FreeCAD import Qt from .manager import CommandManager from femtools.femutils import is_of_type -# Python command definitions +# Python command definitions: # for C++ command definitions see src/Mod/Fem/Command.cpp # TODO, may be even more generic class creation # with type() and identifier instead of class for # the commands which add new document objects. # see https://www.python-course.eu/python3_classes_and_type.php +# Translation: +# some information in the regard of translation can be found in forum post +# https://forum.freecadweb.org/viewtopic.php?f=18&t=62449&p=543845#p543593 class _Analysis(CommandManager): @@ -49,9 +53,12 @@ class _Analysis(CommandManager): def __init__(self): super(_Analysis, self).__init__() - self.menutext = "Analysis container" + self.menutext = Qt.QT_TRANSLATE_NOOP("FEM_Analysis", "Analysis container") self.accel = "S, A" - self.tooltip = "Creates an analysis container with standard solver CalculiX" + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_Analysis", + "Creates an analysis container with standard solver CalculiX" + ) self.is_active = "with_document" def Activated(self): @@ -74,8 +81,11 @@ class _ClippingPlaneAdd(CommandManager): def __init__(self): super(_ClippingPlaneAdd, self).__init__() - self.menutext = "Clipping plane on face" - self.tooltip = "Add a clipping plane on a selected face" + self.menutext = Qt.QT_TRANSLATE_NOOP("FEM_ClippingPlaneAdd", "Clipping plane on face") + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ClippingPlaneAdd", + "Add a clipping plane on a selected face" + ) self.is_active = "with_document" def Activated(self): @@ -123,8 +133,14 @@ class _ClippingPlaneRemoveAll(CommandManager): def __init__(self): super(_ClippingPlaneRemoveAll, self).__init__() - self.menutext = "Remove all clipping planes" - self.tooltip = "Remove all clipping planes" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ClippingPlaneRemoveAll", + "Remove all clipping planes" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ClippingPlaneRemoveAll", + "Remove all clipping planes" + ) self.is_active = "with_document" def Activated(self): @@ -143,8 +159,14 @@ class _ConstantVacuumPermittivity(CommandManager): def __init__(self): super(_ConstantVacuumPermittivity, self).__init__() self.pixmap = "fem-solver-analysis-thermomechanical.svg" - self.menutext = "Constant vacuum permittivity" - self.tooltip = "Creates a FEM constant vacuum permittivity to overwrite standard value" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstantVacuumPermittivity", + "Constant vacuum permittivity" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstantVacuumPermittivity", + "Creates a FEM constant vacuum permittivity to overwrite standard value" + ) self.is_active = "with_document" self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_noset_edit" @@ -156,8 +178,14 @@ class _ConstraintBodyHeatSource(CommandManager): def __init__(self): super(_ConstraintBodyHeatSource, self).__init__() self.pixmap = "FEM_ConstraintHeatflux" # the heatflux icon is used - self.menutext = "Constraint body heat source" - self.tooltip = "Creates a FEM constraint body heat source" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintBodyHeatSource", + "Constraint body heat source" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintBodyHeatSource", + "Creates a FEM constraint body heat source" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_noset_edit" @@ -167,8 +195,14 @@ class _ConstraintCentrif(CommandManager): def __init__(self): super(_ConstraintCentrif, self).__init__() - self.menutext = "Constraint centrif" - self.tooltip = "Creates a FEM constraint centrif" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintCentrif", + "Constraint centrif" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintCentrif", + "Creates a FEM constraint centrif" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -178,8 +212,14 @@ class _ConstraintElectrostaticPotential(CommandManager): def __init__(self): super(_ConstraintElectrostaticPotential, self).__init__() - self.menutext = "Constraint electrostatic potential" - self.tooltip = "Creates a FEM constraint electrostatic potential" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintElectrostaticPotential", + "Constraint electrostatic potential" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintElectrostaticPotential", + "Creates a FEM constraint electrostatic potential" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -189,8 +229,14 @@ class _ConstraintFlowVelocity(CommandManager): def __init__(self): super(_ConstraintFlowVelocity, self).__init__() - self.menutext = "Constraint flow velocity" - self.tooltip = "Creates a FEM constraint flow velocity" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintFlowVelocity", + "Constraint flow velocity" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintFlowVelocity", + "Creates a FEM constraint flow velocity" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -200,8 +246,14 @@ class _ConstraintInitialFlowVelocity(CommandManager): def __init__(self): super(_ConstraintInitialFlowVelocity, self).__init__() - self.menutext = "Constraint initial flow velocity" - self.tooltip = "Creates a FEM constraint initial flow velocity" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintInitialFlowVelocity", + "Constraint initial flow velocity" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintInitialFlowVelocity", + "Creates a FEM constraint initial flow velocity" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -211,8 +263,14 @@ class _ConstraintSectionPrint(CommandManager): def __init__(self): super(_ConstraintSectionPrint, self).__init__() - self.menutext = "Constraint sectionprint" - self.tooltip = "Creates a FEM constraint sectionprint" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintSectionPrint", + "Constraint sectionprint" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintSectionPrint", + "Creates a FEM constraint sectionprint" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -222,8 +280,14 @@ class _ConstraintSelfWeight(CommandManager): def __init__(self): super(_ConstraintSelfWeight, self).__init__() - self.menutext = "Constraint self weight" - self.tooltip = "Creates a FEM constraint self weight" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintSelfWeight", + "Constraint self weight" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintSelfWeight", + "Creates a FEM constraint self weight" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_noset_edit" @@ -233,8 +297,14 @@ class _ConstraintTie(CommandManager): def __init__(self): super(_ConstraintTie, self).__init__() - self.menutext = "Constraint tie" - self.tooltip = "Creates a FEM constraint tie" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintTie", + "Constraint tie" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ConstraintTie", + "Creates a FEM constraint tie" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -244,8 +314,14 @@ class _ElementFluid1D(CommandManager): def __init__(self): super(_ElementFluid1D, self).__init__() - self.menutext = "Fluid section for 1D flow" - self.tooltip = "Creates a FEM fluid section for 1D flow" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ElementFluid1D", + "Fluid section for 1D flow" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ElementFluid1D", + "Creates a FEM fluid section for 1D flow" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -255,8 +331,14 @@ class _ElementGeometry1D(CommandManager): def __init__(self): super(_ElementGeometry1D, self).__init__() - self.menutext = "Beam cross section" - self.tooltip = "Creates a FEM beam cross section" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ElementGeometry1D", + "Beam cross section" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ElementGeometry1D", + "Creates a FEM beam cross section" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -266,8 +348,14 @@ class _ElementGeometry2D(CommandManager): def __init__(self): super(_ElementGeometry2D, self).__init__() - self.menutext = "Shell plate thickness" - self.tooltip = "Creates a FEM shell plate thickness" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ElementGeometry2D", + "Shell plate thickness" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ElementGeometry2D", + "Creates a FEM shell plate thickness" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -277,8 +365,14 @@ class _ElementRotation1D(CommandManager): def __init__(self): super(_ElementRotation1D, self).__init__() - self.menutext = "Beam rotation" - self.tooltip = "Creates a FEM beam rotation" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ElementRotation1D", + "Beam rotation" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ElementRotation1D", + "Creates a FEM beam rotation" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_noset_edit" @@ -288,8 +382,14 @@ class _EquationElectrostatic(CommandManager): def __init__(self): super(_EquationElectrostatic, self).__init__() - self.menutext = "Electrostatic equation" - self.tooltip = "Creates a FEM equation for electrostatic" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationElectrostatic", + "Electrostatic equation" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationElectrostatic", + "Creates a FEM equation for electrostatic" + ) self.is_active = "with_solver_elmer" self.do_activated = "add_obj_on_gui_selobj_noset_edit" @@ -299,8 +399,14 @@ class _EquationElasticity(CommandManager): def __init__(self): super(_EquationElasticity, self).__init__() - self.menutext = "Elasticity equation" - self.tooltip = "Creates a FEM equation for elasticity" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationElasticity", + "Elasticity equation" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationElasticity", + "Creates a FEM equation for elasticity" + ) self.is_active = "with_solver_elmer" self.do_activated = "add_obj_on_gui_selobj_noset_edit" @@ -310,8 +416,14 @@ class _EquationFlow(CommandManager): def __init__(self): super(_EquationFlow, self).__init__() - self.menutext = "Flow equation" - self.tooltip = "Creates a FEM equation for flow" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationFlow", + "Flow equation" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationFlow", + "Creates a FEM equation for flow" + ) self.is_active = "with_solver_elmer" self.do_activated = "add_obj_on_gui_selobj_noset_edit" @@ -321,8 +433,14 @@ class _EquationFlux(CommandManager): def __init__(self): super(_EquationFlux, self).__init__() - self.menutext = "Flux equation" - self.tooltip = "Creates a FEM equation for flux" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationFlux", + "Flux equation" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationFlux", + "Creates a FEM equation for flux" + ) self.is_active = "with_solver_elmer" self.do_activated = "add_obj_on_gui_selobj_noset_edit" @@ -332,8 +450,14 @@ class _EquationElectricforce(CommandManager): def __init__(self): super(_EquationElectricforce, self).__init__() - self.menutext = "Electricforce equation" - self.tooltip = "Creates a FEM equation for electric forces" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationElectricforce", + "Electricforce equation" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationElectricforce", + "Creates a FEM equation for electric forces" + ) self.is_active = "with_solver_elmer" self.do_activated = "add_obj_on_gui_selobj_noset_edit" @@ -343,8 +467,14 @@ class _EquationHeat(CommandManager): def __init__(self): super(_EquationHeat, self).__init__() - self.menutext = "Heat equation" - self.tooltip = "Creates a FEM equation for heat" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationHeat", + "Heat equation" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_EquationHeat", + "Creates a FEM equation for heat" + ) self.is_active = "with_solver_elmer" self.do_activated = "add_obj_on_gui_selobj_noset_edit" @@ -355,8 +485,14 @@ class _Examples(CommandManager): def __init__(self): super(_Examples, self).__init__() self.pixmap = "FemWorkbench" - self.menutext = "Open FEM examples" - self.tooltip = "Open FEM examples" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_Examples", + "Open FEM examples" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_Examples", + "Open FEM examples" + ) self.is_active = "always" def Activated(self): @@ -370,8 +506,14 @@ class _MaterialEditor(CommandManager): def __init__(self): super(_MaterialEditor, self).__init__() self.pixmap = "Arch_Material_Group" - self.menutext = "Material editor" - self.tooltip = "Opens the FreeCAD material editor" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MaterialEditor", + "Material editor" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MaterialEditor", + "Opens the FreeCAD material editor" + ) self.is_active = "always" def Activated(self): @@ -384,8 +526,14 @@ class _MaterialFluid(CommandManager): def __init__(self): super(_MaterialFluid, self).__init__() - self.menutext = "Material for fluid" - self.tooltip = "Creates a FEM material for fluid" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MaterialFluid", + "Material for fluid" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MaterialFluid", + "Creates a FEM material for fluid" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -395,8 +543,14 @@ class _MaterialMechanicalNonlinear(CommandManager): def __init__(self): super(_MaterialMechanicalNonlinear, self).__init__() - self.menutext = "Nonlinear mechanical material" - self.tooltip = "Creates a nonlinear mechanical material" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MaterialMechanicalNonlinear", + "Nonlinear mechanical material" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MaterialMechanicalNonlinear", + "Creates a nonlinear mechanical material" + ) self.is_active = "with_material_solid" def Activated(self): @@ -459,8 +613,14 @@ class _MaterialReinforced(CommandManager): def __init__(self): super(_MaterialReinforced, self).__init__() - self.menutext = "Reinforced material (concrete)" - self.tooltip = "Creates a material for reinforced matrix material such as concrete" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MaterialReinforced", + "Reinforced material (concrete)" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MaterialReinforced", + "Creates a material for reinforced matrix material such as concrete" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -470,9 +630,15 @@ class _MaterialSolid(CommandManager): def __init__(self): super(_MaterialSolid, self).__init__() - self.menutext = "Material for solid" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MaterialSolid", + "Material for solid" + ) self.accel = "M, S" - self.tooltip = "Creates a FEM material for solid" + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MaterialSolid", + "Creates a FEM material for solid" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_set_edit" @@ -482,8 +648,14 @@ class _FEMMesh2Mesh(CommandManager): def __init__(self): super(_FEMMesh2Mesh, self).__init__() - self.menutext = "FEM mesh to mesh" - self.tooltip = "Convert the surface of a FEM mesh to a mesh" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_FEMMesh2Mesh", + "FEM mesh to mesh" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_FEMMesh2Mesh", + "Convert the surface of a FEM mesh to a mesh" + ) self.is_active = "with_femmesh_andor_res" def Activated(self): @@ -523,8 +695,14 @@ class _MeshBoundaryLayer(CommandManager): def __init__(self): super(_MeshBoundaryLayer, self).__init__() - self.menutext = "FEM mesh boundary layer" - self.tooltip = "Creates a FEM mesh boundary layer" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshBoundaryLayer", + "FEM mesh boundary layer" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshBoundaryLayer", + "Creates a FEM mesh boundary layer" + ) self.is_active = "with_gmsh_femmesh" self.do_activated = "add_obj_on_gui_selobj_set_edit" @@ -534,8 +712,14 @@ class _MeshClear(CommandManager): def __init__(self): super(_MeshClear, self).__init__() - self.menutext = "Clear FEM mesh" - self.tooltip = "Clear the Mesh of a FEM mesh object" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshClear", + "Clear FEM mesh" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshClear", + "Clear the Mesh of a FEM mesh object" + ) self.is_active = "with_femmesh" def Activated(self): @@ -553,8 +737,14 @@ class _MeshDisplayInfo(CommandManager): def __init__(self): super(_MeshDisplayInfo, self).__init__() - self.menutext = "Display FEM mesh info" - self.tooltip = "Display FEM mesh info" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshDisplayInfo", + "Display FEM mesh info" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshDisplayInfo", + "Display FEM mesh info" + ) self.is_active = "with_femmesh" def Activated(self): @@ -576,8 +766,14 @@ class _MeshGmshFromShape(CommandManager): def __init__(self): super(_MeshGmshFromShape, self).__init__() - self.menutext = "FEM mesh from shape by Gmsh" - self.tooltip = "Create a FEM mesh from a shape by Gmsh mesher" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshGmshFromShape", + "FEM mesh from shape by Gmsh" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshGmshFromShape", + "Create a FEM mesh from a shape by Gmsh mesher" + ) self.is_active = "with_part_feature" def Activated(self): @@ -615,8 +811,14 @@ class _MeshGroup(CommandManager): def __init__(self): super(_MeshGroup, self).__init__() - self.menutext = "FEM mesh group" - self.tooltip = "Creates a FEM mesh group" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshGroup", + "FEM mesh group" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshGroup", + "Creates a FEM mesh group" + ) self.is_active = "with_gmsh_femmesh" self.do_activated = "add_obj_on_gui_selobj_set_edit" @@ -626,8 +828,14 @@ class _MeshNetgenFromShape(CommandManager): def __init__(self): super(_MeshNetgenFromShape, self).__init__() - self.menutext = "FEM mesh from shape by Netgen" - self.tooltip = "Create a FEM mesh from a solid or face shape by Netgen internal mesher" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshNetgenFromShape", + "FEM mesh from shape by Netgen" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshNetgenFromShape", + "Create a FEM mesh from a solid or face shape by Netgen internal mesher" + ) self.is_active = "with_part_feature" def Activated(self): @@ -665,8 +873,14 @@ class _MeshRegion(CommandManager): def __init__(self): super(_MeshRegion, self).__init__() - self.menutext = "FEM mesh region" - self.tooltip = "Creates a FEM mesh region" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshRegion", + "FEM mesh region" + ) + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_MeshRegion", + "Creates a FEM mesh region" + ) self.is_active = "with_gmsh_femmesh" self.do_activated = "add_obj_on_gui_selobj_set_edit" @@ -676,9 +890,15 @@ class _ResultShow(CommandManager): def __init__(self): super(_ResultShow, self).__init__() - self.menutext = "Show result" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ResultShow", + "Show result" + ) self.accel = "R, S" - self.tooltip = "Shows and visualizes selected result data" + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ResultShow", + "Shows and visualizes selected result data" + ) self.is_active = "with_selresult" def Activated(self): @@ -690,9 +910,15 @@ class _ResultsPurge(CommandManager): def __init__(self): super(_ResultsPurge, self).__init__() - self.menutext = "Purge results" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_ResultsPurge", + "Purge results" + ) self.accel = "R, P" - self.tooltip = "Purges all results from active analysis" + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_ResultsPurge", + "Purges all results from active analysis" + ) self.is_active = "with_results" def Activated(self): @@ -706,9 +932,15 @@ class _SolverCxxtools(CommandManager): def __init__(self): super(_SolverCxxtools, self).__init__() self.pixmap = "FEM_SolverStandard" - self.menutext = "Solver CalculiX Standard" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_SolverCxxtools", + "Solver CalculiX Standard" + ) self.accel = "S, X" - self.tooltip = "Creates a standard FEM solver CalculiX with ccx tools" + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_SolverCxxtools", + "Creates a standard FEM solver CalculiX with ccx tools" + ) self.is_active = "with_analysis" def Activated(self): @@ -741,9 +973,15 @@ class _SolverCalculix(CommandManager): def __init__(self): super(_SolverCalculix, self).__init__() self.pixmap = "FEM_SolverStandard" - self.menutext = "Solver CalculiX (new framework)" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_SolverCalculix", + "Solver CalculiX (new framework)" + ) self.accel = "S, C" - self.tooltip = "Creates a FEM solver CalculiX new framework (less result error handling)" + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_SolverCalculix", + "Creates a FEM solver CalculiX new framework (less result error handling)" + ) self.is_active = "with_analysis" self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_noset_edit" @@ -754,9 +992,15 @@ class _SolverControl(CommandManager): def __init__(self): super(_SolverControl, self).__init__() - self.menutext = "Solver job control" + self.menutext = Qt.QT_TRANSLATE_NOOP( + "FEM_SolverControl", + "Solver job control" + ) self.accel = "S, T" - self.tooltip = "Changes solver attributes and runs the calculations for the selected solver" + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_SolverControl", + "Changes solver attributes and runs the calculations for the selected solver" + ) self.is_active = "with_solver" def Activated(self): @@ -768,9 +1012,12 @@ class _SolverElmer(CommandManager): def __init__(self): super(_SolverElmer, self).__init__() - self.menutext = "Solver Elmer" + self.menutext = Qt.QT_TRANSLATE_NOOP("FEM_SolverElmer", "Solver Elmer") self.accel = "S, E" - self.tooltip = "Creates a FEM solver Elmer" + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_SolverElmer", + "Creates a FEM solver Elmer" + ) self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_noset_edit" @@ -781,9 +1028,9 @@ class _SolverMystran(CommandManager): def __init__(self): super(_SolverMystran, self).__init__() self.pixmap = "FEM_SolverStandard" - self.menutext = "Solver Mystran" + self.menutext = Qt.QT_TRANSLATE_NOOP("FEM_SolverMystran", "Solver Mystran") self.accel = "S, M" - self.tooltip = "Creates a FEM solver Mystran" + self.tooltip = Qt.QT_TRANSLATE_NOOP("FEM_SolverMystran", "Creates a FEM solver Mystran") self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_noset_edit" @@ -793,9 +1040,12 @@ class _SolverRun(CommandManager): def __init__(self): super(_SolverRun, self).__init__() - self.menutext = "Run solver calculations" + self.menutext = Qt.QT_TRANSLATE_NOOP("FEM_SolverRun", "Run solver calculations") self.accel = "S, R" - self.tooltip = "Runs the calculations for the selected solver" + self.tooltip = Qt.QT_TRANSLATE_NOOP( + "FEM_SolverRun", + "Runs the calculations for the selected solver" + ) self.is_active = "with_solver" def Activated(self): @@ -810,9 +1060,9 @@ class _SolverZ88(CommandManager): def __init__(self): super(_SolverZ88, self).__init__() - self.menutext = "Solver Z88" + self.menutext = Qt.QT_TRANSLATE_NOOP("FEM_SolverZ88", "Solver Z88") self.accel = "S, Z" - self.tooltip = "Creates a FEM solver Z88" + self.tooltip = Qt.QT_TRANSLATE_NOOP("FEM_SolverZ88", "Creates a FEM solver Z88") self.is_active = "with_analysis" self.do_activated = "add_obj_on_gui_noset_edit"