Skip to content

Commit 67c7798

Browse files
haseciluoliveroxtoby
authored andcommitted
Fix QT_TRANSLATE_NOOP() commands
- Strings were not picked by `pylupdate` (because of "QtCore.")
1 parent 7758a5a commit 67c7798

19 files changed

+55
-32
lines changed

CfdOF/CfdAnalysis.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import FreeCADGui
3131
from PySide import QtCore
3232

33+
from PySide.QtCore import QT_TRANSLATE_NOOP
3334

3435
def makeCfdAnalysis(name):
3536
""" Create a Cfd Analysis group object """
@@ -90,9 +91,9 @@ def __init__(self):
9091
def GetResources(self):
9192
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "cfd_analysis.svg")
9293
return {'Pixmap': icon_path,
93-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_Analysis", "Analysis container"),
94+
'MenuText': QT_TRANSLATE_NOOP("Cfd_Analysis", "Analysis container"),
9495
'Accel': "N, C",
95-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_Analysis", "Creates an analysis container with a CFD solver")}
96+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_Analysis", "Creates an analysis container with a CFD solver")}
9697

9798
def IsActive(self):
9899
return FreeCAD.ActiveDocument is not None

CfdOF/CfdConsoleProcess.py

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from PySide.QtCore import QProcess, QTextStream
3131
import FreeCAD
3232

33+
from PySide.QtCore import QT_TRANSLATE_NOOP
3334

3435
class CfdConsoleProcess:
3536
"""

CfdOF/CfdFaceSelectWidget.py

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from PySide import QtGui
3636
from PySide.QtCore import QTimer
3737

38+
from PySide.QtCore import QT_TRANSLATE_NOOP
3839

3940
class CfdFaceSelectWidget:
4041
def __init__(self, parent_widget, obj, allow_obj_sel, allow_face_sel, allow_solid_sel,

CfdOF/CfdPreferencePage.py

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from PySide.QtCore import Qt, QObject, QThread
4545
from PySide.QtGui import QApplication
4646

47+
from PySide.QtCore import QT_TRANSLATE_NOOP
4748

4849
# Constants
4950
OPENFOAM_URL = \

CfdOF/CfdReloadWorkbench.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,23 @@
1919
# ***************************************************************************
2020

2121
import os
22+
2223
import FreeCAD
2324
import FreeCADGui
2425
from CfdOF import CfdTools
2526
from PySide import QtCore
2627

28+
from PySide.QtCore import QT_TRANSLATE_NOOP
2729

2830
class CommandCfdReloadWorkbench:
2931

3032
def __init__(self):
3133
pass
3234

3335
def GetResources(self):
34-
return {'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_ReloadWorkbench",
36+
return {'MenuText': QT_TRANSLATE_NOOP("Cfd_ReloadWorkbench",
3537
"Reload CfdOF workbench"),
36-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_ReloadWorkbench",
38+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_ReloadWorkbench",
3739
"Reload source files from disk")}
3840

3941
def IsActive(self):

CfdOF/CfdTimePlot.py

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
from PySide import QtCore
2727
import FreeCAD
2828

29+
from PySide.QtCore import QT_TRANSLATE_NOOP
30+
2931
# If for any reason PyQt5 has been imported, we need to unload it temporarily
3032
# to prevent matplotlib using the PyQt backend instead of PySide
3133
if 'PyQt5.QtCore' in sys.modules:

CfdOF/CfdTools.py

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
from PySide import QtGui
5555
from PySide.QtGui import QFormLayout, QGridLayout
5656

57+
from PySide.QtCore import QT_TRANSLATE_NOOP
5758

5859
# Some standard install locations that are searched if an install directory is not specified
5960
# Supports variable expansion and Unix-style globs (in which case the last lexically-sorted match will be used)

CfdOF/Mesh/CfdDynamicMeshRefinement.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from CfdOF.Mesh import TaskPanelCfdDynamicMeshInterfaceRefinement
3131
from CfdOF.Mesh import TaskPanelCfdDynamicMeshShockRefinement
3232

33+
from PySide.QtCore import QT_TRANSLATE_NOOP
3334

3435
class CommandGroupDynamicMeshRefinement:
3536
def GetCommands(self):
@@ -38,9 +39,9 @@ def GetCommands(self):
3839
def GetResources(self):
3940
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "mesh_dynamic.svg")
4041
return {#'Pixmap': icon_path,
41-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_DynamicMesh", "Dynamic mesh refinement"),
42+
'MenuText': QT_TRANSLATE_NOOP("Cfd_GroupDynamicMeshRefinement", "Dynamic mesh refinement"),
4243
'Accel': "M, D",
43-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_DynamicMesh", "Allows adaptive refinement of the mesh")}
44+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_GroupDynamicMeshRefinement", "Allows adaptive refinement of the mesh")}
4445

4546
def IsActive(self):
4647
sel = FreeCADGui.Selection.getSelection()
@@ -82,9 +83,9 @@ def __init__(self):
8283
def GetResources(self):
8384
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "mesh_dynamic.svg")
8485
return {'Pixmap': icon_path,
85-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_DynamicMesh", "Interface dynamic refinement"),
86+
'MenuText': QT_TRANSLATE_NOOP("Cfd_DynamicMeshInterfaceRefinement", "Interface dynamic refinement"),
8687
'Accel': "M, D",
87-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_DynamicMesh",
88+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_DynamicMeshInterfaceRefinement",
8889
"Activates adaptive mesh refinement at free-surface interfaces")}
8990

9091
def IsActive(self):
@@ -99,7 +100,7 @@ def IsActive(self):
99100
physics = CfdTools.getPhysicsModel(analysis)
100101
if physics:
101102
free_surf = (physics.Phase == 'FreeSurface')
102-
103+
103104
return mesh_selected and free_surf
104105

105106
def Activated(self):
@@ -135,9 +136,9 @@ def __init__(self):
135136
def GetResources(self):
136137
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "mesh_dynamic.svg")
137138
return {'Pixmap': icon_path,
138-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_DynamicMesh", "Shockwave dynamic refinement"),
139+
'MenuText': QT_TRANSLATE_NOOP("Cfd_DynamicMeshShockRefinement", "Shockwave dynamic refinement"),
139140
'Accel': "M, S",
140-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_DynamicMesh",
141+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_DynamicMeshShockRefinement",
141142
"Activates adaptive mesh refinement for shocks")}
142143

143144
def IsActive(self):

CfdOF/Mesh/CfdMesh.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from CfdOF.CfdTools import addObjectProperty
2626
import os
2727

28+
from PySide.QtCore import QT_TRANSLATE_NOOP
2829

2930
MESHER_DESCRIPTIONS = ['cfMesh', 'snappyHexMesh', 'gmsh (tetrahedral)', 'gmsh (polyhedral)']
3031
MESHERS = ['cfMesh', 'snappyHexMesh', 'gmsh', 'gmsh']
@@ -44,9 +45,9 @@ class CommandCfdMeshFromShape:
4445
def GetResources(self):
4546
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "mesh.svg")
4647
return {'Pixmap': icon_path,
47-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_MeshFromShape",
48+
'MenuText': QT_TRANSLATE_NOOP("Cfd_MeshFromShape",
4849
"CFD mesh"),
49-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_MeshFromShape",
50+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_MeshFromShape",
5051
"Create a mesh using cfMesh, snappyHexMesh or gmsh")}
5152

5253
def IsActive(self):

CfdOF/Mesh/CfdMeshRefinement.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import Part
3434
from CfdOF.Mesh import TaskPanelCfdMeshRefinement
3535

36+
from PySide.QtCore import QT_TRANSLATE_NOOP
37+
3638
# Constants
3739
EXTRUSION_NAMES = ["2D planar mesh", "2D wedge mesh", "Patch-normal", "Rotational"]
3840
EXTRUSION_TYPES = ["2DPlanar", "2DWedge", "PatchNormal", "Rotational"]
@@ -56,9 +58,9 @@ class CommandMeshRegion:
5658
def GetResources(self):
5759
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "mesh_region.svg")
5860
return {'Pixmap': icon_path,
59-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_MeshRegion", "Mesh refinement"),
61+
'MenuText': QT_TRANSLATE_NOOP("Cfd_MeshRegion", "Mesh refinement"),
6062
'Accel': "M, R",
61-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_MeshRegion", "Creates a mesh refinement")}
63+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_MeshRegion", "Creates a mesh refinement")}
6264

6365
def IsActive(self):
6466
sel = FreeCADGui.Selection.getSelection()

CfdOF/Mesh/TaskPanelCfdMesh.py

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from PySide.QtCore import Qt
4242
from PySide.QtGui import QApplication
4343

44+
from PySide.QtCore import QT_TRANSLATE_NOOP
4445

4546
class TaskPanelCfdMesh:
4647
""" The TaskPanel for editing References property of CfdMesh objects and creation of new CFD mesh """

CfdOF/PostProcess/CfdReportingFunction.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
from CfdOF.CfdTools import addObjectProperty
3030
import os
3131

32+
from PySide.QtCore import QT_TRANSLATE_NOOP
33+
3234
# Constants
3335
OBJECT_NAMES = ["Force", "ForceCoefficients", "Probes"]
3436
OBJECT_DESCRIPTIONS = ["Calculate forces on patches", "Calculate force coefficients from patches",
@@ -52,9 +54,9 @@ class CommandCfdReportingFunction:
5254
def GetResources(self):
5355
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "monitor.svg")
5456
return {'Pixmap': icon_path,
55-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_ReportingFunctions",
57+
'MenuText': QT_TRANSLATE_NOOP("Cfd_ReportingFunctions",
5658
"Reporting function"),
57-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_ReportingFunctions",
59+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_ReportingFunctions",
5860
"Create a reporting function for the current case")}
5961

6062
def IsActive(self):

CfdOF/Solve/CfdFluidBoundary.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
from PySide import QtCore
3535
from CfdOF.Solve import TaskPanelCfdFluidBoundary
3636

37+
from PySide.QtCore import QT_TRANSLATE_NOOP
38+
3739
# Constants
3840
BOUNDARY_NAMES = ["Wall", "Inlet", "Outlet", "Open", "Constraint", "Baffle"]
3941

@@ -233,9 +235,9 @@ def GetResources(self):
233235
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "boundary.svg")
234236
return {
235237
'Pixmap': icon_path,
236-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_FluidBoundary", "Fluid boundary"),
238+
'MenuText': QT_TRANSLATE_NOOP("Cfd_FluidBoundary", "Fluid boundary"),
237239
'Accel': "C, W",
238-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_FluidBoundary", "Creates a CFD fluid boundary")}
240+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_FluidBoundary", "Creates a CFD fluid boundary")}
239241

240242
def IsActive(self):
241243
return CfdTools.getActiveAnalysis() is not None

CfdOF/Solve/CfdInitialiseFlowField.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from CfdOF.CfdTools import addObjectProperty
3535
from CfdOF.Solve import TaskPanelCfdInitialiseInternalFlowField
3636

37+
from PySide.QtCore import QT_TRANSLATE_NOOP
3738

3839
def makeCfdInitialFlowField(name="InitialiseFields"):
3940
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", name)
@@ -49,9 +50,9 @@ class CommandCfdInitialiseInternalFlowField:
4950
def GetResources(self):
5051
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "initialise.svg")
5152
return {'Pixmap': icon_path,
52-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_InitialiseInternal", "Initialise"),
53+
'MenuText': QT_TRANSLATE_NOOP("Cfd_InitialiseInternal", "Initialise"),
5354
'Accel': "",
54-
'ToolTip': QtCore.QT_TRANSLATE_NOOP(
55+
'ToolTip': QT_TRANSLATE_NOOP(
5556
"Cfd_InitialiseInternal",
5657
"Initialise internal flow variables based on the selected physics model")}
5758

CfdOF/Solve/CfdPhysicsSelection.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from CfdOF import CfdTools
3333
from CfdOF.CfdTools import addObjectProperty
3434

35+
from PySide.QtCore import QT_TRANSLATE_NOOP
3536

3637
def makeCfdPhysicsSelection(name="PhysicsModel"):
3738
# DocumentObjectGroupPython, FeaturePython, GeometryPython
@@ -48,9 +49,9 @@ class CommandCfdPhysicsSelection:
4849
def GetResources(self):
4950
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "physics.svg")
5051
return {'Pixmap': icon_path,
51-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_PhysicsModel", "Select models"),
52+
'MenuText': QT_TRANSLATE_NOOP("Cfd_PhysicsModel", "Select models"),
5253
'Accel': "",
53-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_PhysicsModel", "Select the physics model")}
54+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_PhysicsModel", "Select the physics model")}
5455

5556
def IsActive(self):
5657
return CfdTools.getActiveAnalysis() is not None

CfdOF/Solve/CfdScalarTransportFunction.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from pivy import coin
3030
from PySide import QtCore
3131

32+
from PySide.QtCore import QT_TRANSLATE_NOOP
3233

3334
def makeCfdScalarTransportFunction(name="ScalarTransportFunction"):
3435
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", name)
@@ -46,9 +47,9 @@ def __init__(self):
4647
def GetResources(self):
4748
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "scalartransport.svg")
4849
return {'Pixmap': icon_path,
49-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_ScalarTransportFunction",
50+
'MenuText': QT_TRANSLATE_NOOP("Cfd_ScalarTransportFunctions",
5051
"Cfd scalar transport function"),
51-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_ScalarTransportFunction",
52+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_ScalarTransportFunctions",
5253
"Create a scalar transport function")}
5354

5455
def IsActive(self):

CfdOF/Solve/CfdSolverFoam.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
from CfdOF.CfdTimePlot import TimePlot
3131
if FreeCAD.GuiUp:
3232
import FreeCADGui
33-
from PySide import QtCore
3433

34+
from PySide.QtCore import QT_TRANSLATE_NOOP
3535

3636
# Constants
3737
START_FROM = ["startTime", "latestTime"]
@@ -49,9 +49,9 @@ class CommandCfdSolverFoam:
4949
def GetResources(self):
5050
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "solver.svg")
5151
return {'Pixmap': icon_path,
52-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_SolverControl", "Solver job control"),
52+
'MenuText': QT_TRANSLATE_NOOP("Cfd_SolverControl", "Solver job control"),
5353
'Accel': "S, C",
54-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_SolverControl", "Edit properties and run solver")}
54+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_SolverControl", "Edit properties and run solver")}
5555

5656
def IsActive(self):
5757
return CfdTools.getActiveAnalysis() is not None

CfdOF/Solve/CfdZone.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from CfdOF import CfdTools
3232
from CfdOF.CfdTools import addObjectProperty
3333

34+
from PySide.QtCore import QT_TRANSLATE_NOOP
3435

3536
# Constants
3637
POROUS_CORRELATIONS = ['DarcyForchheimer', 'Jakob']
@@ -65,9 +66,9 @@ class CommandCfdPorousZone:
6566
def GetResources(self):
6667
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "porous.svg")
6768
return {'Pixmap': icon_path,
68-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_PorousZone", "Porous zone"),
69+
'MenuText': QT_TRANSLATE_NOOP("Cfd_PorousZone", "Porous zone"),
6970
'Accel': "",
70-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_PorousZone", "Select and create a porous zone")}
71+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_PorousZone", "Select and create a porous zone")}
7172

7273
def IsActive(self):
7374
return CfdTools.getActiveAnalysis() is not None
@@ -85,9 +86,9 @@ class CommandCfdInitialisationZone:
8586
def GetResources(self):
8687
icon_path = os.path.join(CfdTools.getModulePath(), "Gui", "Icons", "alpha.svg")
8788
return {'Pixmap': icon_path,
88-
'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_InitialisationZone", "Initialisation zone"),
89+
'MenuText': QT_TRANSLATE_NOOP("Cfd_InitialisationZone", "Initialisation zone"),
8990
'Accel': "",
90-
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Cfd_InitialisationZone",
91+
'ToolTip': QT_TRANSLATE_NOOP("Cfd_InitialisationZone",
9192
"Select and create an initialisation zone")}
9293

9394
def IsActive(self):

CfdOF/Solve/TaskPanelCfdSolverControl.py

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from PySide.QtCore import Qt
3636
from PySide.QtGui import QApplication
3737

38+
from PySide.QtCore import QT_TRANSLATE_NOOP
3839

3940
class TaskPanelCfdSolverControl:
4041
def __init__(self, solver_runner_obj):

0 commit comments

Comments
 (0)