diff --git a/src/Mod/Arch/ArchAxis.py b/src/Mod/Arch/ArchAxis.py index b4afa1f63..723a0be25 100644 --- a/src/Mod/Arch/ArchAxis.py +++ b/src/Mod/Arch/ArchAxis.py @@ -28,9 +28,12 @@ if FreeCAD.GuiUp: from PySide import QtCore, QtGui from DraftTools import translate from pivy import coin + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Axis System" __author__ = "Yorik van Havre" @@ -59,9 +62,9 @@ class _CommandAxis: "the Arch Axis command definition" def GetResources(self): return {'Pixmap' : 'Arch_Axis', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Axis","Axis"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Axis","Axis"), 'Accel': "A, X", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Axis","Creates an axis system.")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Axis","Creates an axis system.")} def Activated(self): FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Axis")) @@ -81,9 +84,9 @@ class _CommandAxis: class _Axis: "The Axis object" def __init__(self,obj): - obj.addProperty("App::PropertyFloatList","Distances","Arch", "The intervals between axes") - obj.addProperty("App::PropertyFloatList","Angles","Arch", "The angles of each axis") - obj.addProperty("App::PropertyLength","Length","Arch", "The length of the axes") + obj.addProperty("App::PropertyFloatList","Distances","Arch", QT_TRANSLATE_NOOP("App::Property","The intervals between axes")) + obj.addProperty("App::PropertyFloatList","Angles","Arch", QT_TRANSLATE_NOOP("App::Property","The angles of each axis")) + obj.addProperty("App::PropertyLength","Length","Arch", QT_TRANSLATE_NOOP("App::Property","The length of the axes")) obj.addProperty("App::PropertyPlacement","Placement","Base","") obj.addProperty("Part::PropertyPartShape","Shape","Base","") self.Type = "Axis" @@ -126,8 +129,8 @@ class _ViewProviderAxis: "A View Provider for the Axis object" def __init__(self,vobj): - vobj.addProperty("App::PropertyLength","BubbleSize","Arch", "The size of the axis bubbles") - vobj.addProperty("App::PropertyEnumeration","NumberingStyle","Arch", "The numbering style") + vobj.addProperty("App::PropertyLength","BubbleSize","Arch", QT_TRANSLATE_NOOP("App::Property","The size of the axis bubbles")) + vobj.addProperty("App::PropertyEnumeration","NumberingStyle","Arch", QT_TRANSLATE_NOOP("App::Property","The numbering style")) vobj.addProperty("App::PropertyEnumeration","DrawStyle","Base","") vobj.addProperty("App::PropertyEnumeration","BubblePosition","Base","") vobj.addProperty("App::PropertyFloat","LineWidth","Base","") diff --git a/src/Mod/Arch/ArchBuilding.py b/src/Mod/Arch/ArchBuilding.py index 13547cb71..9a08708ff 100644 --- a/src/Mod/Arch/ArchBuilding.py +++ b/src/Mod/Arch/ArchBuilding.py @@ -28,9 +28,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Building" __author__ = "Yorik van Havre" @@ -240,7 +243,7 @@ class _Building(ArchFloor._Floor): "The Building object" def __init__(self,obj): ArchFloor._Floor.__init__(self,obj) - obj.addProperty("App::PropertyEnumeration","BuildingType","Arch","The type of this building") + obj.addProperty("App::PropertyEnumeration","BuildingType","Arch",QT_TRANSLATE_NOOP("App::Property","The type of this building")) self.Type = "Building" obj.setEditorMode('Height',2) obj.BuildingType = BuildingTypes diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index df682c00d..314b6e877 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -37,9 +37,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtGui,QtCore from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt def addToComponent(compobject,addobject,mod=None): @@ -289,20 +292,20 @@ class ComponentTaskPanel: class Component: "The default Arch Component object" def __init__(self,obj): - obj.addProperty("App::PropertyLink","Base","Arch","The base object this component is built upon") - obj.addProperty("App::PropertyLink","CloneOf","Arch","The object this component is cloning") - obj.addProperty("App::PropertyLinkList","Additions","Arch","Other shapes that are appended to this object") - obj.addProperty("App::PropertyLinkList","Subtractions","Arch","Other shapes that are subtracted from this object") - obj.addProperty("App::PropertyString","Description","Arch","An optional description for this component") - obj.addProperty("App::PropertyString","Tag","Arch","An optional tag for this component") - obj.addProperty("App::PropertyMap","IfcAttributes","Arch","Custom IFC properties and attributes") - obj.addProperty("App::PropertyLink","BaseMaterial","Material","A material for this object") - obj.addProperty("App::PropertyEnumeration","Role","Arch","The role of this object") - obj.addProperty("App::PropertyBool","MoveWithHost","Arch","Specifies if this object must move together when its host is moved") - obj.addProperty("App::PropertyLink","IfcProperties","Arch","Custom IFC properties and attributes") - obj.addProperty("App::PropertyArea","VerticalArea","Arch","The area of all vertical faces of this object") - obj.addProperty("App::PropertyArea","HorizontalArea","Arch","The area of the projection of this object onto the XY plane") - obj.addProperty("App::PropertyLength","PerimeterLength","Arch","The perimeter length of the horizontal area") + obj.addProperty("App::PropertyLink","Base","Arch",QT_TRANSLATE_NOOP("App::Property","The base object this component is built upon")) + obj.addProperty("App::PropertyLink","CloneOf","Arch",QT_TRANSLATE_NOOP("App::Property","The object this component is cloning")) + obj.addProperty("App::PropertyLinkList","Additions","Arch",QT_TRANSLATE_NOOP("App::Property","Other shapes that are appended to this object")) + obj.addProperty("App::PropertyLinkList","Subtractions","Arch",QT_TRANSLATE_NOOP("App::Property","Other shapes that are subtracted from this object")) + obj.addProperty("App::PropertyString","Description","Arch",QT_TRANSLATE_NOOP("App::Property","An optional description for this component")) + obj.addProperty("App::PropertyString","Tag","Arch",QT_TRANSLATE_NOOP("App::Property","An optional tag for this component")) + obj.addProperty("App::PropertyMap","IfcAttributes","Arch",QT_TRANSLATE_NOOP("App::Property","Custom IFC properties and attributes")) + obj.addProperty("App::PropertyLink","BaseMaterial","Material",QT_TRANSLATE_NOOP("App::Property","A material for this object")) + obj.addProperty("App::PropertyEnumeration","Role","Arch",QT_TRANSLATE_NOOP("App::Property","The role of this object")) + obj.addProperty("App::PropertyBool","MoveWithHost","Arch",QT_TRANSLATE_NOOP("App::Property","Specifies if this object must move together when its host is moved")) + obj.addProperty("App::PropertyLink","IfcProperties","Arch",QT_TRANSLATE_NOOP("App::Property","Custom IFC properties and attributes")) + obj.addProperty("App::PropertyArea","VerticalArea","Arch",QT_TRANSLATE_NOOP("App::Property","The area of all vertical faces of this object")) + obj.addProperty("App::PropertyArea","HorizontalArea","Arch",QT_TRANSLATE_NOOP("App::Property","The area of the projection of this object onto the XY plane")) + obj.addProperty("App::PropertyLength","PerimeterLength","Arch",QT_TRANSLATE_NOOP("App::Property","The perimeter length of the horizontal area")) obj.Proxy = self self.Type = "Component" self.Subvolume = None diff --git a/src/Mod/Arch/ArchEquipment.py b/src/Mod/Arch/ArchEquipment.py index d81534c96..688aa646a 100644 --- a/src/Mod/Arch/ArchEquipment.py +++ b/src/Mod/Arch/ArchEquipment.py @@ -33,9 +33,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt # presets Roles = ["Furniture", "Hydro Equipment", "Electric Equipment"] @@ -163,9 +166,9 @@ class _CommandEquipment: "the Arch Equipment command definition" def GetResources(self): return {'Pixmap' : 'Arch_Equipment', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Equipment","Equipment"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Equipment","Equipment"), 'Accel': "E, Q", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Equipment","Creates an equipment object from a selected object (Part or Mesh)")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Equipment","Creates an equipment object from a selected object (Part or Mesh)")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -191,8 +194,8 @@ class _Command3Views: "the Arch 3Views command definition" def GetResources(self): return {'Pixmap' : 'Arch_3Views', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_3Views","3 views from mesh"), - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_3Views","Creates 3 views (top, front, side) from a mesh-based object")} + 'MenuText': QT_TRANSLATE_NOOP("Arch_3Views","3 views from mesh"), + 'ToolTip': QT_TRANSLATE_NOOP("Arch_3Views","Creates 3 views (top, front, side) from a mesh-based object")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -235,13 +238,10 @@ class _Equipment(ArchComponent.Component): "The Equipment object" def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - #obj.addProperty("Part::PropertyPartShape","TopView","Arch","an optional 2D shape representing a top view of this equipment") - #obj.addProperty("Part::PropertyPartShape","FrontView","Arch","an optional 2D shape representing a front view of this equipment") - #obj.addProperty("Part::PropertyPartShape","SideView","Arch","an optional 2D shape representing a side view of this equipment") - obj.addProperty("App::PropertyString","Model","Arch","The model description of this equipment") - obj.addProperty("App::PropertyString","Url","Arch","The url of the product page of this equipment") - obj.addProperty("App::PropertyVectorList","SnapPoints","Arch","Additional snap points for this equipment") - obj.addProperty("App::PropertyFloat","EquipmentPower","Arch","The electric power needed by this equipment in Watts") + obj.addProperty("App::PropertyString","Model","Arch",QT_TRANSLATE_NOOP("App::Property","The model description of this equipment")) + obj.addProperty("App::PropertyString","Url","Arch",QT_TRANSLATE_NOOP("App::Property","The url of the product page of this equipment")) + obj.addProperty("App::PropertyVectorList","SnapPoints","Arch",QT_TRANSLATE_NOOP("App::Property","Additional snap points for this equipment")) + obj.addProperty("App::PropertyFloat","EquipmentPower","Arch",QT_TRANSLATE_NOOP("App::Property","The electric power needed by this equipment in Watts")) self.Type = "Equipment" obj.Role = Roles obj.Proxy = self diff --git a/src/Mod/Arch/ArchFloor.py b/src/Mod/Arch/ArchFloor.py index db239331b..c07b3ef38 100644 --- a/src/Mod/Arch/ArchFloor.py +++ b/src/Mod/Arch/ArchFloor.py @@ -28,9 +28,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Arch Floor" __author__ = "Yorik van Havre" @@ -52,9 +55,9 @@ class _CommandFloor: "the Arch Cell command definition" def GetResources(self): return {'Pixmap' : 'Arch_Floor', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Floor","Floor"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Floor","Floor"), 'Accel': "F, L", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Floor","Creates a floor object including selected objects")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Floor","Creates a floor object including selected objects")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -97,11 +100,11 @@ Floor creation aborted.\n" ) class _Floor: "The Floor object" def __init__(self,obj): - obj.addProperty("App::PropertyLength","Height","Arch","The height of this object") - obj.addProperty("App::PropertyArea","Area", "Arch","The computed floor area of this floor") + obj.addProperty("App::PropertyLength","Height","Arch",QT_TRANSLATE_NOOP("App::Property","The height of this object")) + obj.addProperty("App::PropertyArea","Area", "Arch",QT_TRANSLATE_NOOP("App::Property","The computed floor area of this floor")) if not hasattr(obj,"Placement"): # obj can be a Part Feature and already has a placement - obj.addProperty("App::PropertyPlacement","Placement","Arch","The placement of this object") + obj.addProperty("App::PropertyPlacement","Placement","Arch",QT_TRANSLATE_NOOP("App::Property","The placement of this object")) self.Type = "Floor" obj.Proxy = self self.Object = obj diff --git a/src/Mod/Arch/ArchFrame.py b/src/Mod/Arch/ArchFrame.py index a77352c44..74f0a6129 100644 --- a/src/Mod/Arch/ArchFrame.py +++ b/src/Mod/Arch/ArchFrame.py @@ -27,9 +27,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Arch Frame" __author__ = "Yorik van Havre" @@ -59,9 +62,9 @@ class _CommandFrame: def GetResources(self): return {'Pixmap' : 'Arch_Frame', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Frame","Frame"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Frame","Frame"), 'Accel': "F, R", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Frame","Creates a frame object from a planar 2D object and a profile")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Frame","Creates a frame object from a planar 2D object and a profile")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -81,11 +84,11 @@ class _Frame(ArchComponent.Component): def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyLink","Profile","Arch","The profile used to build this frame") - obj.addProperty("App::PropertyBool","Align","Arch","Specifies if the profile must be aligned with the extrusion wires") - obj.addProperty("App::PropertyVectorDistance","Offset","Arch","An offset vector between the base sketch and the frame") - obj.addProperty("App::PropertyInteger","BasePoint","Arch","Crossing point of the path on the profile.") - obj.addProperty("App::PropertyAngle","Rotation","Arch","The rotation of the profile around its extrusion axis") + obj.addProperty("App::PropertyLink","Profile","Arch",QT_TRANSLATE_NOOP("App::Property","The profile used to build this frame")) + obj.addProperty("App::PropertyBool","Align","Arch",QT_TRANSLATE_NOOP("App::Property","Specifies if the profile must be aligned with the extrusion wires")) + obj.addProperty("App::PropertyVectorDistance","Offset","Arch",QT_TRANSLATE_NOOP("App::Property","An offset vector between the base sketch and the frame")) + obj.addProperty("App::PropertyInteger","BasePoint","Arch",QT_TRANSLATE_NOOP("App::Property","Crossing point of the path on the profile.")) + obj.addProperty("App::PropertyAngle","Rotation","Arch",QT_TRANSLATE_NOOP("App::Property","The rotation of the profile around its extrusion axis")) self.Type = "Frame" obj.Role = Roles diff --git a/src/Mod/Arch/ArchPanel.py b/src/Mod/Arch/ArchPanel.py index 88c59190a..815b50627 100644 --- a/src/Mod/Arch/ArchPanel.py +++ b/src/Mod/Arch/ArchPanel.py @@ -27,9 +27,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Panel" __author__ = "Yorik van Havre" @@ -89,9 +92,9 @@ class _CommandPanel: "the Arch Panel command definition" def GetResources(self): return {'Pixmap' : 'Arch_Panel', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Panel","Panel"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Panel","Panel"), 'Accel': "P, A", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Panel","Creates a panel object from scratch or from a selected object (sketch, wire, face or solid)")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Panel","Creates a panel object from scratch or from a selected object (sketch, wire, face or solid)")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -254,11 +257,11 @@ class _Panel(ArchComponent.Component): "The Panel object" def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyLength","Length","Arch", "The length of this element, if not based on a profile") - obj.addProperty("App::PropertyLength","Width","Arch", "The width of this element, if not based on a profile") - obj.addProperty("App::PropertyLength","Thickness","Arch","The thickness or extrusion depth of this element") - obj.addProperty("App::PropertyInteger","Sheets","Arch", "The number of sheets to use") - obj.addProperty("App::PropertyLength","Offset","Arch", "The offset between this panel and its baseline") + obj.addProperty("App::PropertyLength","Length","Arch", QT_TRANSLATE_NOOP("App::Property","The length of this element, if not based on a profile")) + obj.addProperty("App::PropertyLength","Width","Arch", QT_TRANSLATE_NOOP("App::Property","The width of this element, if not based on a profile")) + obj.addProperty("App::PropertyLength","Thickness","Arch",QT_TRANSLATE_NOOP("App::Property","The thickness or extrusion depth of this element")) + obj.addProperty("App::PropertyInteger","Sheets","Arch", QT_TRANSLATE_NOOP("App::Property","The number of sheets to use")) + obj.addProperty("App::PropertyLength","Offset","Arch", QT_TRANSLATE_NOOP("App::Property","The offset between this panel and its baseline")) obj.Sheets = 1 self.Type = "Panel" @@ -388,14 +391,14 @@ class _PanelView: "A Drawing view for Arch Panels" def __init__(self, obj): - obj.addProperty("App::PropertyLink","Source","Base","The linked object") - obj.addProperty("App::PropertyFloat","LineWidth","Drawing view","The line width of the rendered objects") - obj.addProperty("App::PropertyColor","LineColor","Drawing view","The color of the panel outline") - obj.addProperty("App::PropertyLength","FontSize","Tag view","The size of the tag text") - obj.addProperty("App::PropertyColor","TextColor","Tag view","The color of the tag text") - obj.addProperty("App::PropertyFloat","TextX","Tag view","The X offset of the tag text") - obj.addProperty("App::PropertyFloat","TextY","Tag view","The Y offset of the tag text") - obj.addProperty("App::PropertyString","FontName","Tag view","The font of the tag text") + obj.addProperty("App::PropertyLink","Source","Base",QT_TRANSLATE_NOOP("App::Property","The linked object")) + obj.addProperty("App::PropertyFloat","LineWidth","Drawing view",QT_TRANSLATE_NOOP("App::Property","The line width of the rendered objects")) + obj.addProperty("App::PropertyColor","LineColor","Drawing view",QT_TRANSLATE_NOOP("App::Property","The color of the panel outline")) + obj.addProperty("App::PropertyLength","FontSize","Tag view",QT_TRANSLATE_NOOP("App::Property","The size of the tag text")) + obj.addProperty("App::PropertyColor","TextColor","Tag view",QT_TRANSLATE_NOOP("App::Property","The color of the tag text")) + obj.addProperty("App::PropertyFloat","TextX","Tag view",QT_TRANSLATE_NOOP("App::Property","The X offset of the tag text")) + obj.addProperty("App::PropertyFloat","TextY","Tag view",QT_TRANSLATE_NOOP("App::Property","The Y offset of the tag text")) + obj.addProperty("App::PropertyString","FontName","Tag view",QT_TRANSLATE_NOOP("App::Property","The font of the tag text")) obj.Proxy = self self.Type = "PanelView" obj.LineWidth = 0.35 diff --git a/src/Mod/Arch/ArchPipe.py b/src/Mod/Arch/ArchPipe.py index c40a0eb05..40cd571a7 100644 --- a/src/Mod/Arch/ArchPipe.py +++ b/src/Mod/Arch/ArchPipe.py @@ -27,6 +27,12 @@ if FreeCAD.GuiUp: import FreeCADGui, Arch_rc, os from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP +else: + def translate(ctxt,txt): + return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__ = "Arch Pipe tools" __author__ = "Yorik van Havre" @@ -83,9 +89,9 @@ class _CommandPipe: def GetResources(self): return {'Pixmap' : 'Arch_Pipe', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Pipe","Pipe"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Pipe","Pipe"), 'Accel': "P, I", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Pipe","Creates a pipe object from a given Wire or Line")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Pipe","Creates a pipe object from a given Wire or Line")} def IsActive(self): @@ -118,9 +124,9 @@ class _CommandPipeConnector: def GetResources(self): return {'Pixmap' : 'Arch_PipeConnector', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_PipeConnector","Connector"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_PipeConnector","Connector"), 'Accel': "P, C", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Pipe","Creates a connector between 2 or 3 selected pipes")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Pipe","Creates a connector between 2 or 3 selected pipes")} def IsActive(self): @@ -156,11 +162,11 @@ class _ArchPipe(ArchComponent.Component): ArchComponent.Component.__init__(self,obj) self.Type = "Pipe" - obj.addProperty("App::PropertyLength", "Diameter", "Arch", "The diameter of this pipe, if not based on a profile") - obj.addProperty("App::PropertyLength", "Length", "Arch", "The length of this pipe, if not based on an edge") - obj.addProperty("App::PropertyLink", "Profile", "Arch", "An optional closed profile to base this pipe on") - obj.addProperty("App::PropertyLength", "OffsetStart", "Arch", "Offset from the start point") - obj.addProperty("App::PropertyLength", "OffsetEnd", "Arch", "Offset from the end point") + obj.addProperty("App::PropertyLength", "Diameter", "Arch", QT_TRANSLATE_NOOP("App::Property","The diameter of this pipe, if not based on a profile")) + obj.addProperty("App::PropertyLength", "Length", "Arch", QT_TRANSLATE_NOOP("App::Property","The length of this pipe, if not based on an edge")) + obj.addProperty("App::PropertyLink", "Profile", "Arch", QT_TRANSLATE_NOOP("App::Property","An optional closed profile to base this pipe on")) + obj.addProperty("App::PropertyLength", "OffsetStart", "Arch", QT_TRANSLATE_NOOP("App::Property","Offset from the start point")) + obj.addProperty("App::PropertyLength", "OffsetEnd", "Arch", QT_TRANSLATE_NOOP("App::Property","Offset from the end point")) def execute(self,obj): @@ -267,9 +273,9 @@ class _ArchPipeConnector(ArchComponent.Component): ArchComponent.Component.__init__(self,obj) self.Type = "PipeConnector" - obj.addProperty("App::PropertyLength", "Radius", "Arch", "The curvature radius of this connector") - obj.addProperty("App::PropertyLinkList", "Pipes", "Arch", "The pipes linked by this connector") - obj.addProperty("App::PropertyEnumeration", "ConnectorType", "Arch", "The type of this connector") + obj.addProperty("App::PropertyLength", "Radius", "Arch", QT_TRANSLATE_NOOP("App::Property","The curvature radius of this connector")) + obj.addProperty("App::PropertyLinkList", "Pipes", "Arch", QT_TRANSLATE_NOOP("App::Property","The pipes linked by this connector")) + obj.addProperty("App::PropertyEnumeration", "ConnectorType", "Arch", QT_TRANSLATE_NOOP("App::Property","The type of this connector")) obj.ConnectorType = ["Corner","Tee"] obj.setEditorMode("ConnectorType",1) @@ -412,6 +418,8 @@ if FreeCAD.GuiUp: def GetCommands(self): return tuple(['Arch_Pipe','Arch_PipeConnector']) def GetResources(self): - return { 'MenuText': translate("Arch",'Pipe tools'), 'ToolTip': translate("Arch",'Pipe tools')} + return { 'MenuText': QT_TRANSLATE_NOOP("Arch_PipeTools",'Pipe tools'), + 'ToolTip': QT_TRANSLATE_NOOP("Arch_PipeTools",'Pipe tools') + } FreeCADGui.addCommand('Arch_PipeTools', _ArchPipeGroupCommand()) diff --git a/src/Mod/Arch/ArchPrecast.py b/src/Mod/Arch/ArchPrecast.py index 118dc63ad..a44a2bd28 100644 --- a/src/Mod/Arch/ArchPrecast.py +++ b/src/Mod/Arch/ArchPrecast.py @@ -29,7 +29,16 @@ Beams, pillars, slabs and panels""" import ArchCommands,ArchComponent,FreeCAD from FreeCAD import Vector - +if FreeCAD.GuiUp: + import FreeCADGui + from PySide import QtCore, QtGui + from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP +else: + def translate(ctxt,txt): + return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt class _Precast(ArchComponent.Component): @@ -39,11 +48,11 @@ class _Precast(ArchComponent.Component): def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyDistance","Length","Arch","The length of this element") - obj.addProperty("App::PropertyDistance","Width","Arch","The width of this element") - obj.addProperty("App::PropertyDistance","Height","Arch","The height of this element") - obj.addProperty("App::PropertyLinkList","Armatures","Arch","Armatures contained in this element") - obj.addProperty("App::PropertyVectorList","Nodes","Arch","The structural nodes of this element") + obj.addProperty("App::PropertyDistance","Length","Arch",QT_TRANSLATE_NOOP("App::Property","The length of this element")) + obj.addProperty("App::PropertyDistance","Width","Arch",QT_TRANSLATE_NOOP("App::Property","The width of this element")) + obj.addProperty("App::PropertyDistance","Height","Arch",QT_TRANSLATE_NOOP("App::Property","The height of this element")) + obj.addProperty("App::PropertyLinkList","Armatures","Arch",QT_TRANSLATE_NOOP("App::Property","Armatures contained in this element")) + obj.addProperty("App::PropertyVectorList","Nodes","Arch",QT_TRANSLATE_NOOP("App::Property","The structural nodes of this element")) self.Type = "Precast" obj.Role = ["Beam","Column","Panel","Slab","Stairs"] @@ -66,10 +75,10 @@ class _PrecastBeam(_Precast): def __init__(self,obj): _Precast.__init__(self,obj) - obj.addProperty("App::PropertyDistance","Chamfer","Arch","The size of the chamfer of this element") - obj.addProperty("App::PropertyDistance","DentLength","Arch","The dent length of this element") - obj.addProperty("App::PropertyDistance","DentHeight","Arch","The dent height of this element") - obj.addProperty("App::PropertyStringList","Dents","Arch","The dents of this element") + obj.addProperty("App::PropertyDistance","Chamfer","Arch",QT_TRANSLATE_NOOP("App::Property","The size of the chamfer of this element")) + obj.addProperty("App::PropertyDistance","DentLength","Arch",QT_TRANSLATE_NOOP("App::Property","The dent length of this element")) + obj.addProperty("App::PropertyDistance","DentHeight","Arch",QT_TRANSLATE_NOOP("App::Property","The dent height of this element")) + obj.addProperty("App::PropertyStringList","Dents","Arch",QT_TRANSLATE_NOOP("App::Property","The dents of this element")) obj.Role = ["Beam"] def execute(self,obj): @@ -171,8 +180,8 @@ class _PrecastIbeam(_Precast): def __init__(self,obj): _Precast.__init__(self,obj) - obj.addProperty("App::PropertyDistance","Chamfer","Arch","The chamfer length of this element") - obj.addProperty("App::PropertyDistance","BeamBase","Arch","The base length of this element") + obj.addProperty("App::PropertyDistance","Chamfer","Arch",QT_TRANSLATE_NOOP("App::Property","The chamfer length of this element")) + obj.addProperty("App::PropertyDistance","BeamBase","Arch",QT_TRANSLATE_NOOP("App::Property","The base length of this element")) obj.Role = ["Beam"] def execute(self,obj): @@ -222,12 +231,12 @@ class _PrecastPillar(_Precast): def __init__(self,obj): _Precast.__init__(self,obj) - obj.addProperty("App::PropertyDistance","Chamfer","Arch","The size of the chamfer of this element") - obj.addProperty("App::PropertyDistance","GrooveDepth","Arch","The groove depth of this element") - obj.addProperty("App::PropertyDistance","GrooveHeight","Arch","The groove height of this element") - obj.addProperty("App::PropertyDistance","GrooveSpacing","Arch","The spacing between the grooves of this element") - obj.addProperty("App::PropertyInteger","GrooveNumber","Arch","The number of grooves of this element") - obj.addProperty("App::PropertyStringList","Dents","Arch","The dents of this element") + obj.addProperty("App::PropertyDistance","Chamfer","Arch",QT_TRANSLATE_NOOP("App::Property","The size of the chamfer of this element")) + obj.addProperty("App::PropertyDistance","GrooveDepth","Arch",QT_TRANSLATE_NOOP("App::Property","The groove depth of this element")) + obj.addProperty("App::PropertyDistance","GrooveHeight","Arch",QT_TRANSLATE_NOOP("App::Property","The groove height of this element")) + obj.addProperty("App::PropertyDistance","GrooveSpacing","Arch",QT_TRANSLATE_NOOP("App::Property","The spacing between the grooves of this element")) + obj.addProperty("App::PropertyInteger","GrooveNumber","Arch",QT_TRANSLATE_NOOP("App::Property","The number of grooves of this element")) + obj.addProperty("App::PropertyStringList","Dents","Arch",QT_TRANSLATE_NOOP("App::Property","The dents of this element")) obj.Role = ["Column"] def execute(self,obj): @@ -344,9 +353,9 @@ class _PrecastPanel(_Precast): def __init__(self,obj): _Precast.__init__(self,obj) - obj.addProperty("App::PropertyDistance","Chamfer","Arch","The size of the chamfer of this element") - obj.addProperty("App::PropertyDistance","DentWidth","Arch","The dent width of this element") - obj.addProperty("App::PropertyDistance","DentHeight","Arch","The dent height of this element") + obj.addProperty("App::PropertyDistance","Chamfer","Arch",QT_TRANSLATE_NOOP("App::Property","The size of the chamfer of this element")) + obj.addProperty("App::PropertyDistance","DentWidth","Arch",QT_TRANSLATE_NOOP("App::Property","The dent width of this element")) + obj.addProperty("App::PropertyDistance","DentHeight","Arch",QT_TRANSLATE_NOOP("App::Property","The dent height of this element")) obj.Role = ["Plate"] def execute(self,obj): @@ -439,12 +448,12 @@ class _PrecastSlab(_Precast): def __init__(self,obj): _Precast.__init__(self,obj) - obj.addProperty("App::PropertyEnumeration","SlabType","Arch","The type of this slab") - obj.addProperty("App::PropertyDistance","SlabBase","Arch","The size of the base of this element") - obj.addProperty("App::PropertyInteger","HoleNumber","Arch","The number of holes in this element") - obj.addProperty("App::PropertyDistance","HoleMajor","Arch","The major radius of the holes of this element") - obj.addProperty("App::PropertyDistance","HoleMinor","Arch","The minor radius of the holes of this element") - obj.addProperty("App::PropertyDistance","HoleSpacing","Arch","The spacing between the holes of this element") + obj.addProperty("App::PropertyEnumeration","SlabType","Arch",QT_TRANSLATE_NOOP("App::Property","The type of this slab")) + obj.addProperty("App::PropertyDistance","SlabBase","Arch",QT_TRANSLATE_NOOP("App::Property","The size of the base of this element")) + obj.addProperty("App::PropertyInteger","HoleNumber","Arch",QT_TRANSLATE_NOOP("App::Property","The number of holes in this element")) + obj.addProperty("App::PropertyDistance","HoleMajor","Arch",QT_TRANSLATE_NOOP("App::Property","The major radius of the holes of this element")) + obj.addProperty("App::PropertyDistance","HoleMinor","Arch",QT_TRANSLATE_NOOP("App::Property","The minor radius of the holes of this element")) + obj.addProperty("App::PropertyDistance","HoleSpacing","Arch",QT_TRANSLATE_NOOP("App::Property","The spacing between the holes of this element")) obj.Role = ["Slab"] obj.SlabType = ["Champagne","Hat"] @@ -532,10 +541,10 @@ class _PrecastStairs(_Precast): def __init__(self,obj): _Precast.__init__(self,obj) - obj.addProperty("App::PropertyDistance","DownLength","Arch","The length of the down floor of this element") - obj.addProperty("App::PropertyInteger","RiserNumber","Arch","The number of risers in this element") - obj.addProperty("App::PropertyDistance","Riser","Arch","The riser height of this element") - obj.addProperty("App::PropertyDistance","Tread","Arch","The tread depth of this element") + obj.addProperty("App::PropertyDistance","DownLength","Arch",QT_TRANSLATE_NOOP("App::Property","The length of the down floor of this element")) + obj.addProperty("App::PropertyInteger","RiserNumber","Arch",QT_TRANSLATE_NOOP("App::Property","The number of risers in this element")) + obj.addProperty("App::PropertyDistance","Riser","Arch",QT_TRANSLATE_NOOP("App::Property","The riser height of this element")) + obj.addProperty("App::PropertyDistance","Tread","Arch",QT_TRANSLATE_NOOP("App::Property","The tread depth of this element")) obj.Role = ["Stairs"] def execute(self,obj): diff --git a/src/Mod/Arch/ArchProfile.py b/src/Mod/Arch/ArchProfile.py index 01c0422d6..1edd154f4 100644 --- a/src/Mod/Arch/ArchProfile.py +++ b/src/Mod/Arch/ArchProfile.py @@ -29,9 +29,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Profile" __author__ = "Yorik van Havre" @@ -98,8 +101,8 @@ class _ProfileC(_Profile): '''A parametric circular tubeprofile. Profile data: [Outside diameter, Inside diameter]''' def __init__(self,obj, profile): - obj.addProperty("App::PropertyLength","OutDiameter","Draft","Outside Diameter").OutDiameter = profile[4] - obj.addProperty("App::PropertyLength","Thickness","Draft","Wall thickness").Thickness = profile[5] + obj.addProperty("App::PropertyLength","OutDiameter","Draft",QT_TRANSLATE_NOOP("App::Property","Outside Diameter")).OutDiameter = profile[4] + obj.addProperty("App::PropertyLength","Thickness","Draft",QT_TRANSLATE_NOOP("App::Property","Wall thickness")).Thickness = profile[5] _Profile.__init__(self,obj,profile) def execute(self,obj): @@ -118,10 +121,10 @@ class _ProfileH(_Profile): '''A parametric H or I beam profile. Profile data: [width, height, web thickness, flange thickness] (see http://en.wikipedia.org/wiki/I-beam for reference)''' def __init__(self,obj, profile): - obj.addProperty("App::PropertyLength","Width","Draft","Width of the beam").Width = profile[4] - obj.addProperty("App::PropertyLength","Height","Draft","Height of the beam").Height = profile[5] - obj.addProperty("App::PropertyLength","WebThickness","Draft","Thickness of the web").WebThickness = profile[6] - obj.addProperty("App::PropertyLength","FlangeThickness","Draft","Thickness of the flanges").FlangeThickness = profile[7] + obj.addProperty("App::PropertyLength","Width","Draft",QT_TRANSLATE_NOOP("App::Property","Width of the beam")).Width = profile[4] + obj.addProperty("App::PropertyLength","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the beam")).Height = profile[5] + obj.addProperty("App::PropertyLength","WebThickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the web")).WebThickness = profile[6] + obj.addProperty("App::PropertyLength","FlangeThickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the flanges")).FlangeThickness = profile[7] _Profile.__init__(self,obj,profile) def execute(self,obj): @@ -148,8 +151,8 @@ class _ProfileR(_Profile): '''A parametric rectangular beam profile based on [Width, Height]''' def __init__(self,obj, profile): - obj.addProperty("App::PropertyLength","Width","Draft","Width of the beam").Width = profile[4] - obj.addProperty("App::PropertyLength","Height","Draft","Height of the beam").Height = profile[5] + obj.addProperty("App::PropertyLength","Width","Draft",QT_TRANSLATE_NOOP("App::Property","Width of the beam")).Width = profile[4] + obj.addProperty("App::PropertyLength","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the beam")).Height = profile[5] _Profile.__init__(self,obj,profile) def execute(self,obj): @@ -168,9 +171,9 @@ class _ProfileRH(_Profile): '''A parametric Rectangular hollow beam profile. Profile data: [width, height, thickness]''' def __init__(self,obj, profile): - obj.addProperty("App::PropertyLength","Width","Draft","Width of the beam").Width = profile[4] - obj.addProperty("App::PropertyLength","Height","Draft","Height of the beam").Height = profile[5] - obj.addProperty("App::PropertyLength","Thickness","Draft","Thickness of the sides").Thickness = profile[6] + obj.addProperty("App::PropertyLength","Width","Draft",QT_TRANSLATE_NOOP("App::Property","Width of the beam")).Width = profile[4] + obj.addProperty("App::PropertyLength","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the beam")).Height = profile[5] + obj.addProperty("App::PropertyLength","Thickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the sides")).Thickness = profile[6] _Profile.__init__(self,obj,profile) def execute(self,obj): @@ -194,10 +197,10 @@ class _ProfileU(_Profile): '''A parametric H or I beam profile. Profile data: [width, height, web thickness, flange thickness] (see http://en.wikipedia.org/wiki/I-beam forreference)''' def __init__(self,obj, profile): - obj.addProperty("App::PropertyLength","Width","Draft","Width of the beam").Width = profile[4] - obj.addProperty("App::PropertyLength","Height","Draft","Height of the beam").Height = profile[5] - obj.addProperty("App::PropertyLength","WebThickness","Draft","Thickness of the webs").WebThickness = profile[6] - obj.addProperty("App::PropertyLength","FlangeThickness","Draft","Thickness of the flange").FlangeThickness = profile[7] + obj.addProperty("App::PropertyLength","Width","Draft",QT_TRANSLATE_NOOP("App::Property","Width of the beam")).Width = profile[4] + obj.addProperty("App::PropertyLength","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the beam")).Height = profile[5] + obj.addProperty("App::PropertyLength","WebThickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the webs")).WebThickness = profile[6] + obj.addProperty("App::PropertyLength","FlangeThickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the flange")).FlangeThickness = profile[7] _Profile.__init__(self,obj,profile) def execute(self,obj): diff --git a/src/Mod/Arch/ArchRebar.py b/src/Mod/Arch/ArchRebar.py index 67160f138..b788da614 100644 --- a/src/Mod/Arch/ArchRebar.py +++ b/src/Mod/Arch/ArchRebar.py @@ -27,9 +27,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Rebar" __author__ = "Yorik van Havre" @@ -87,9 +90,9 @@ class _CommandRebar: def GetResources(self): return {'Pixmap' : 'Arch_Rebar', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Rebar","Rebar"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Rebar","Rebar"), 'Accel': "R, B", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Rebar","Creates a Reinforcement bar from the selected face of a structural object")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Rebar","Creates a Reinforcement bar from the selected face of a structural object")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -146,13 +149,13 @@ class _Rebar(ArchComponent.Component): def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyLength","Diameter","Arch","The diameter of the bar") - obj.addProperty("App::PropertyLength","OffsetStart","Arch","The distance between the border of the beam and the fist bar (concrete cover).") - obj.addProperty("App::PropertyLength","OffsetEnd","Arch","The distance between the border of the beam and the last bar (concrete cover).") - obj.addProperty("App::PropertyInteger","Amount","Arch","The amount of bars") - obj.addProperty("App::PropertyLength","Spacing","Arch","The spacing between the bars") - obj.addProperty("App::PropertyVector","Direction","Arch","The direction to use to spread the bars. Keep (0,0,0) for automatic direction.") - obj.addProperty("App::PropertyFloat","Rounding","Arch","The fillet to apply to the angle of the base profile. This value is multiplied by the bar diameter.") + obj.addProperty("App::PropertyLength","Diameter","Arch",QT_TRANSLATE_NOOP("App::Property","The diameter of the bar")) + obj.addProperty("App::PropertyLength","OffsetStart","Arch",QT_TRANSLATE_NOOP("App::Property","The distance between the border of the beam and the fist bar (concrete cover).")) + obj.addProperty("App::PropertyLength","OffsetEnd","Arch",QT_TRANSLATE_NOOP("App::Property","The distance between the border of the beam and the last bar (concrete cover).")) + obj.addProperty("App::PropertyInteger","Amount","Arch",QT_TRANSLATE_NOOP("App::Property","The amount of bars")) + obj.addProperty("App::PropertyLength","Spacing","Arch",QT_TRANSLATE_NOOP("App::Property","The spacing between the bars")) + obj.addProperty("App::PropertyVector","Direction","Arch",QT_TRANSLATE_NOOP("App::Property","The direction to use to spread the bars. Keep (0,0,0) for automatic direction.")) + obj.addProperty("App::PropertyFloat","Rounding","Arch",QT_TRANSLATE_NOOP("App::Property","The fillet to apply to the angle of the base profile. This value is multiplied by the bar diameter.")) self.Type = "Rebar" obj.setEditorMode("Spacing",1) diff --git a/src/Mod/Arch/ArchRoof.py b/src/Mod/Arch/ArchRoof.py index 693340b50..a534a6851 100644 --- a/src/Mod/Arch/ArchRoof.py +++ b/src/Mod/Arch/ArchRoof.py @@ -27,9 +27,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Roof" __author__ = "Yorik van Havre", "Jonathan Wiedemann" @@ -108,9 +111,9 @@ class _CommandRoof: "the Arch Roof command definition" def GetResources(self): return {'Pixmap' : 'Arch_Roof', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Roof","Roof"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Roof","Roof"), 'Accel': "R, F", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Roof","Creates a roof object from the selected wire.")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Roof","Creates a roof object from the selected wire.")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -151,15 +154,15 @@ class _Roof(ArchComponent.Component): def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyFloatList","Angles","Arch", "A list of angles for each roof pane") - obj.addProperty("App::PropertyFloatList","Runs","Arch", "A list of horizontal length projections for each roof pane") - obj.addProperty("App::PropertyIntegerList","IdRel","Arch", "A list of IDs of relative profiles for each roof pane") - obj.addProperty("App::PropertyFloatList","Thickness","Arch", "A list of thicknesses for each roof pane") - obj.addProperty("App::PropertyFloatList","Overhang","Arch", "A list of overhangs for each roof pane") - obj.addProperty("App::PropertyFloatList","Heights","Arch", "A list of calculated heights for each roof pane") - obj.addProperty("App::PropertyInteger","Face","Base", "The face number of the base object used to build this roof") - obj.addProperty("App::PropertyLength","RidgeLength","Arch","The total length of ridges and hips of this roof") - obj.addProperty("App::PropertyLength","BorderLength","Arch","The total length of borders of this roof") + obj.addProperty("App::PropertyFloatList","Angles","Arch", QT_TRANSLATE_NOOP("App::Property","A list of angles for each roof pane")) + obj.addProperty("App::PropertyFloatList","Runs","Arch", QT_TRANSLATE_NOOP("App::Property","A list of horizontal length projections for each roof pane")) + obj.addProperty("App::PropertyIntegerList","IdRel","Arch", QT_TRANSLATE_NOOP("App::Property","A list of IDs of relative profiles for each roof pane")) + obj.addProperty("App::PropertyFloatList","Thickness","Arch", QT_TRANSLATE_NOOP("App::Property","A list of thicknesses for each roof pane")) + obj.addProperty("App::PropertyFloatList","Overhang","Arch", QT_TRANSLATE_NOOP("App::Property","A list of overhangs for each roof pane")) + obj.addProperty("App::PropertyFloatList","Heights","Arch", QT_TRANSLATE_NOOP("App::Property","A list of calculated heights for each roof pane")) + obj.addProperty("App::PropertyInteger","Face","Base", QT_TRANSLATE_NOOP("App::Property","The face number of the base object used to build this roof")) + obj.addProperty("App::PropertyLength","RidgeLength","Arch", QT_TRANSLATE_NOOP("App::Property","The total length of ridges and hips of this roof")) + obj.addProperty("App::PropertyLength","BorderLength","Arch", QT_TRANSLATE_NOOP("App::Property","The total length of borders of this roof")) self.Type = "Roof" obj.Proxy = self obj.setEditorMode("RidgeLength",1) diff --git a/src/Mod/Arch/ArchSchedule.py b/src/Mod/Arch/ArchSchedule.py index 4381d09f4..033e4e88c 100644 --- a/src/Mod/Arch/ArchSchedule.py +++ b/src/Mod/Arch/ArchSchedule.py @@ -27,6 +27,12 @@ if FreeCAD.GuiUp: import FreeCADGui, Arch_rc, os from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP +else: + def translate(ctxt,txt): + return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__ = "Arch Schedule" __author__ = "Yorik van Havre" @@ -42,8 +48,8 @@ class _CommandArchSchedule: def GetResources(self): return {'Pixmap': 'Arch_Schedule', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Schedule","Schedule"), - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Schedule","Creates a schedule to collect data from the model")} + 'MenuText': QT_TRANSLATE_NOOP("Arch_Schedule","Schedule"), + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Schedule","Creates a schedule to collect data from the model")} def Activated(self): taskd = _ArchScheduleTaskPanel() @@ -61,12 +67,12 @@ class _ArchSchedule: "the Arch Schedule object" def __init__(self,obj): - obj.addProperty("App::PropertyStringList","Description","Arch","The description column") - obj.addProperty("App::PropertyStringList","Value", "Arch","The values column") - obj.addProperty("App::PropertyStringList","Unit", "Arch","The units column") - obj.addProperty("App::PropertyStringList","Objects", "Arch","The objects column") - obj.addProperty("App::PropertyStringList","Filter", "Arch","The filter column") - obj.addProperty("App::PropertyLink", "Result", "Arch","The spreadsheet to print the results to") + obj.addProperty("App::PropertyStringList","Description","Arch",QT_TRANSLATE_NOOP("App::Property","The description column")) + obj.addProperty("App::PropertyStringList","Value", "Arch",QT_TRANSLATE_NOOP("App::Property","The values column")) + obj.addProperty("App::PropertyStringList","Unit", "Arch",QT_TRANSLATE_NOOP("App::Property","The units column")) + obj.addProperty("App::PropertyStringList","Objects", "Arch",QT_TRANSLATE_NOOP("App::Property","The objects column")) + obj.addProperty("App::PropertyStringList","Filter", "Arch",QT_TRANSLATE_NOOP("App::Property","The filter column")) + obj.addProperty("App::PropertyLink", "Result", "Arch",QT_TRANSLATE_NOOP("App::Property","The spreadsheet to print the results to")) obj.Proxy = self self.Type = "Schedule" diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index b249e7d1c..282211589 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -28,9 +28,12 @@ if FreeCAD.GuiUp: from PySide import QtCore, QtGui from DraftTools import translate from pivy import coin + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt def makeSectionPlane(objectslist=None,name="Section"): """makeSectionPlane([objectslist]) : Creates a Section plane objects including the @@ -74,8 +77,8 @@ class _CommandSectionPlane: def GetResources(self): return {'Pixmap' : 'Arch_SectionPlane', 'Accel': "S, E", - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_SectionPlane","Section Plane"), - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_SectionPlane","Creates a section plane object, including the selected objects")} + 'MenuText': QT_TRANSLATE_NOOP("Arch_SectionPlane","Section Plane"), + 'ToolTip': QT_TRANSLATE_NOOP("Arch_SectionPlane","Creates a section plane object, including the selected objects")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -100,10 +103,10 @@ class _SectionPlane: "A section plane object" def __init__(self,obj): obj.Proxy = self - obj.addProperty("App::PropertyPlacement","Placement","Base","The placement of this object") + obj.addProperty("App::PropertyPlacement","Placement","Base",QT_TRANSLATE_NOOP("App::Property","The placement of this object")) obj.addProperty("Part::PropertyPartShape","Shape","Base","") - obj.addProperty("App::PropertyLinkList","Objects","Arch","The objects that must be considered by this section plane. Empty means all document") - obj.addProperty("App::PropertyBool","OnlySolids","Arch","If false, non-solids will be cut too, with possible wrong results.") + obj.addProperty("App::PropertyLinkList","Objects","Arch",QT_TRANSLATE_NOOP("App::Property","The objects that must be considered by this section plane. Empty means all document")) + obj.addProperty("App::PropertyBool","OnlySolids","Arch",QT_TRANSLATE_NOOP("App::Property","If false, non-solids will be cut too, with possible wrong results.")) obj.OnlySolids = True self.Type = "SectionPlane" @@ -142,13 +145,13 @@ class _SectionPlane: class _ViewProviderSectionPlane: "A View Provider for Section Planes" def __init__(self,vobj): - vobj.addProperty("App::PropertyLength","DisplayLength","Arch","The display length of this section plane") - vobj.addProperty("App::PropertyLength","DisplayHeight","Arch","The display height of this section plane") - vobj.addProperty("App::PropertyLength","ArrowSize","Arch","The size of the arrows of this section plane") + vobj.addProperty("App::PropertyLength","DisplayLength","Arch",QT_TRANSLATE_NOOP("App::Property","The display length of this section plane")) + vobj.addProperty("App::PropertyLength","DisplayHeight","Arch",QT_TRANSLATE_NOOP("App::Property","The display height of this section plane")) + vobj.addProperty("App::PropertyLength","ArrowSize","Arch",QT_TRANSLATE_NOOP("App::Property","The size of the arrows of this section plane")) vobj.addProperty("App::PropertyPercent","Transparency","Base","") vobj.addProperty("App::PropertyFloat","LineWidth","Base","") vobj.addProperty("App::PropertyColor","LineColor","Base","") - vobj.addProperty("App::PropertyBool","CutView","Arch","Show the cut in the 3D view") + vobj.addProperty("App::PropertyBool","CutView","Arch",QT_TRANSLATE_NOOP("App::Property","Show the cut in the 3D view")) vobj.DisplayLength = 1000 vobj.DisplayHeight = 1000 vobj.ArrowSize = 50 @@ -308,13 +311,13 @@ class _ViewProviderSectionPlane: class _ArchDrawingView: def __init__(self, obj): - obj.addProperty("App::PropertyLink","Source","Base","The linked object") - obj.addProperty("App::PropertyEnumeration","RenderingMode","Drawing view","The rendering mode to use") - obj.addProperty("App::PropertyBool","ShowCut","Drawing view","If cut geometry is shown or not") - obj.addProperty("App::PropertyBool","ShowFill","Drawing view","If cut geometry is filled or not") - obj.addProperty("App::PropertyFloat","LineWidth","Drawing view","The line width of the rendered objects") - obj.addProperty("App::PropertyLength","FontSize","Drawing view","The size of the texts inside this object") - obj.addProperty("App::PropertyBool","AlwaysOn","Drawing view","If checked, source objects are displayed regardless of being visible in the 3D model") + obj.addProperty("App::PropertyLink","Source","Base",QT_TRANSLATE_NOOP("App::Property","The linked object")) + obj.addProperty("App::PropertyEnumeration","RenderingMode","Drawing view",QT_TRANSLATE_NOOP("App::Property","The rendering mode to use")) + obj.addProperty("App::PropertyBool","ShowCut","Drawing view",QT_TRANSLATE_NOOP("App::Property","If cut geometry is shown or not")) + obj.addProperty("App::PropertyBool","ShowFill","Drawing view",QT_TRANSLATE_NOOP("App::Property","If cut geometry is filled or not")) + obj.addProperty("App::PropertyFloat","LineWidth","Drawing view",QT_TRANSLATE_NOOP("App::Property","The line width of the rendered objects")) + obj.addProperty("App::PropertyLength","FontSize","Drawing view",QT_TRANSLATE_NOOP("App::Property","The size of the texts inside this object")) + obj.addProperty("App::PropertyBool","AlwaysOn","Drawing view",QT_TRANSLATE_NOOP("App::Property","If checked, source objects are displayed regardless of being visible in the 3D model")) obj.RenderingMode = ["Solid","Wireframe"] obj.RenderingMode = "Wireframe" obj.LineWidth = 0.35 diff --git a/src/Mod/Arch/ArchServer.py b/src/Mod/Arch/ArchServer.py index 8408f0cf6..b40fe416a 100644 --- a/src/Mod/Arch/ArchServer.py +++ b/src/Mod/Arch/ArchServer.py @@ -27,9 +27,12 @@ from PySide import QtCore, QtGui if FreeCAD.GuiUp: import FreeCADGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Arch Server commands" __author__ = "Yorik van Havre" @@ -47,8 +50,8 @@ class _CommandBimserver: def GetResources(self): return {'Pixmap' : 'Arch_Bimserver', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Bimserver","BIM server"), - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Bimserver","Connects and interacts with a BIM server instance")} + 'MenuText': QT_TRANSLATE_NOOP("Arch_Bimserver","BIM server"), + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Bimserver","Connects and interacts with a BIM server instance")} def Activated(self): try: diff --git a/src/Mod/Arch/ArchSite.py b/src/Mod/Arch/ArchSite.py index 25ff52e88..7022160fb 100644 --- a/src/Mod/Arch/ArchSite.py +++ b/src/Mod/Arch/ArchSite.py @@ -28,9 +28,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Site" __author__ = "Yorik van Havre" @@ -59,9 +62,9 @@ class _CommandSite: "the Arch Site command definition" def GetResources(self): return {'Pixmap' : 'Arch_Site', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Site","Site"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Site","Site"), 'Accel': "S, I", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Site","Creates a site object including selected objects.")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Site","Creates a site object including selected objects.")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -110,24 +113,24 @@ class _Site(ArchFloor._Floor): def __init__(self,obj): ArchFloor._Floor.__init__(self,obj) - obj.addProperty("App::PropertyLink","Terrain","Arch","The base terrain of this site") - obj.addProperty("App::PropertyString","Address","Arch","The street and housenumber of this site") - obj.addProperty("App::PropertyString","PostalCode","Arch","The postal or zip code of this site") - obj.addProperty("App::PropertyString","City","Arch","The city of this site") - obj.addProperty("App::PropertyString","Country","Arch","The country of this site") - obj.addProperty("App::PropertyFloat","Latitude","Arch","The latitude of this site") - obj.addProperty("App::PropertyFloat","Longitude","Arch","The latitude of this site") - obj.addProperty("App::PropertyLength","Elevation","Arch","The elevation of level 0 of this site") - obj.addProperty("App::PropertyString","Url","Arch","An url that shows this site in a mapping website") - obj.addProperty("App::PropertyLinkList","Group","Arch","The objects that are part of this site") - obj.addProperty("App::PropertyLinkList","Additions","Arch","Other shapes that are appended to this object") - obj.addProperty("App::PropertyLinkList","Subtractions","Arch","Other shapes that are subtracted from this object") - obj.addProperty("App::PropertyArea","ProjectedArea","Arch","The area of the projection of this object onto the XY plane") - obj.addProperty("App::PropertyLength","Perimeter","Arch","The perimeter length of this terrain") - obj.addProperty("App::PropertyVolume","AdditionVolume","Arch","The volume of earth to be added to this terrain") - obj.addProperty("App::PropertyVolume","SubtractionVolume","Arch","The volume of earth to be removed from this terrain") - obj.addProperty("App::PropertyVector","ExtrusionVector","Arch","An extrusion vector to use when performing boolean operations") - obj.addProperty("App::PropertyBool","RemoveSplitter","Arch","Remove splitters from the resulting shape") + obj.addProperty("App::PropertyLink","Terrain","Arch",QT_TRANSLATE_NOOP("App::Property","The base terrain of this site")) + obj.addProperty("App::PropertyString","Address","Arch",QT_TRANSLATE_NOOP("App::Property","The street and housenumber of this site")) + obj.addProperty("App::PropertyString","PostalCode","Arch",QT_TRANSLATE_NOOP("App::Property","The postal or zip code of this site")) + obj.addProperty("App::PropertyString","City","Arch",QT_TRANSLATE_NOOP("App::Property","The city of this site")) + obj.addProperty("App::PropertyString","Country","Arch",QT_TRANSLATE_NOOP("App::Property","The country of this site")) + obj.addProperty("App::PropertyFloat","Latitude","Arch",QT_TRANSLATE_NOOP("App::Property","The latitude of this site")) + obj.addProperty("App::PropertyFloat","Longitude","Arch",QT_TRANSLATE_NOOP("App::Property","The latitude of this site")) + obj.addProperty("App::PropertyLength","Elevation","Arch",QT_TRANSLATE_NOOP("App::Property","The elevation of level 0 of this site")) + obj.addProperty("App::PropertyString","Url","Arch",QT_TRANSLATE_NOOP("App::Property","An url that shows this site in a mapping website")) + obj.addProperty("App::PropertyLinkList","Group","Arch",QT_TRANSLATE_NOOP("App::Property","The objects that are part of this site")) + obj.addProperty("App::PropertyLinkList","Additions","Arch",QT_TRANSLATE_NOOP("App::Property","Other shapes that are appended to this object")) + obj.addProperty("App::PropertyLinkList","Subtractions","Arch",QT_TRANSLATE_NOOP("App::Property","Other shapes that are subtracted from this object")) + obj.addProperty("App::PropertyArea","ProjectedArea","Arch",QT_TRANSLATE_NOOP("App::Property","The area of the projection of this object onto the XY plane")) + obj.addProperty("App::PropertyLength","Perimeter","Arch",QT_TRANSLATE_NOOP("App::Property","The perimeter length of this terrain")) + obj.addProperty("App::PropertyVolume","AdditionVolume","Arch",QT_TRANSLATE_NOOP("App::Property","The volume of earth to be added to this terrain")) + obj.addProperty("App::PropertyVolume","SubtractionVolume","Arch",QT_TRANSLATE_NOOP("App::Property","The volume of earth to be removed from this terrain")) + obj.addProperty("App::PropertyVector","ExtrusionVector","Arch",QT_TRANSLATE_NOOP("App::Property","An extrusion vector to use when performing boolean operations")) + obj.addProperty("App::PropertyBool","RemoveSplitter","Arch",QT_TRANSLATE_NOOP("App::Property","Remove splitters from the resulting shape")) self.Type = "Site" obj.setEditorMode('Height',2) obj.ExtrusionVector = FreeCAD.Vector(0,0,-100000) diff --git a/src/Mod/Arch/ArchSpace.py b/src/Mod/Arch/ArchSpace.py index 62a91d4ca..b9c422880 100644 --- a/src/Mod/Arch/ArchSpace.py +++ b/src/Mod/Arch/ArchSpace.py @@ -155,9 +155,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt def makeSpace(objects=None,baseobj=None,name="Space"): """makeSpace([objects]): Creates a space object from the given objects. Objects can be one @@ -202,9 +205,9 @@ class _CommandSpace: "the Arch Space command definition" def GetResources(self): return {'Pixmap' : 'Arch_Space', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Space","Space"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Space","Space"), 'Accel': "S, P", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Space","Creates a space object from selected boundary objects")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Space","Creates a space object from selected boundary objects")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -232,20 +235,20 @@ class _Space(ArchComponent.Component): "A space object" def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyLinkSubList","Boundaries", "Arch","The objects that make the boundaries of this space object") - obj.addProperty("App::PropertyArea", "Area", "Arch","The computed floor area of this space") - obj.addProperty("App::PropertyString", "FinishFloor", "Arch","The finishing of the floor of this space") - obj.addProperty("App::PropertyString", "FinishWalls", "Arch","The finishing of the walls of this space") - obj.addProperty("App::PropertyString", "FinishCeiling", "Arch","The finishing of the ceiling of this space") - obj.addProperty("App::PropertyLinkList", "Group", "Arch","Objects that are included inside this space, such as furniture") - obj.addProperty("App::PropertyEnumeration","SpaceType", "Arch","The type of this space") - obj.addProperty("App::PropertyLength", "FloorThickness","Arch","The thickness of the floor finish") - obj.addProperty("App::PropertyLink", "Zone", "Arch","A zone this space is part of") - obj.addProperty("App::PropertyInteger", "NumberOfPeople","Arch","The number of people who typically occupy this space") - obj.addProperty("App::PropertyFloat", "LightingPower", "Arch","The electric power needed to light this space in Watts") - obj.addProperty("App::PropertyFloat", "EquipmentPower","Arch","The electric power needed by the equipments of this space in Watts") - obj.addProperty("App::PropertyBool", "AutoPower", "Arch","If True, Equipment Power will be automatically filled by the equipments included in this space") - obj.addProperty("App::PropertyEnumeration","Conditioning", "Arch","The type of air conditioning of this space") + obj.addProperty("App::PropertyLinkSubList","Boundaries", "Arch",QT_TRANSLATE_NOOP("App::Property","The objects that make the boundaries of this space object")) + obj.addProperty("App::PropertyArea", "Area", "Arch",QT_TRANSLATE_NOOP("App::Property","The computed floor area of this space")) + obj.addProperty("App::PropertyString", "FinishFloor", "Arch",QT_TRANSLATE_NOOP("App::Property","The finishing of the floor of this space")) + obj.addProperty("App::PropertyString", "FinishWalls", "Arch",QT_TRANSLATE_NOOP("App::Property","The finishing of the walls of this space")) + obj.addProperty("App::PropertyString", "FinishCeiling", "Arch",QT_TRANSLATE_NOOP("App::Property","The finishing of the ceiling of this space")) + obj.addProperty("App::PropertyLinkList", "Group", "Arch",QT_TRANSLATE_NOOP("App::Property","Objects that are included inside this space, such as furniture")) + obj.addProperty("App::PropertyEnumeration","SpaceType", "Arch",QT_TRANSLATE_NOOP("App::Property","The type of this space")) + obj.addProperty("App::PropertyLength", "FloorThickness","Arch",QT_TRANSLATE_NOOP("App::Property","The thickness of the floor finish")) + obj.addProperty("App::PropertyLink", "Zone", "Arch",QT_TRANSLATE_NOOP("App::Property","A zone this space is part of")) + obj.addProperty("App::PropertyInteger", "NumberOfPeople","Arch",QT_TRANSLATE_NOOP("App::Property","The number of people who typically occupy this space")) + obj.addProperty("App::PropertyFloat", "LightingPower", "Arch",QT_TRANSLATE_NOOP("App::Property","The electric power needed to light this space in Watts")) + obj.addProperty("App::PropertyFloat", "EquipmentPower","Arch",QT_TRANSLATE_NOOP("App::Property","The electric power needed by the equipments of this space in Watts")) + obj.addProperty("App::PropertyBool", "AutoPower", "Arch",QT_TRANSLATE_NOOP("App::Property","If True, Equipment Power will be automatically filled by the equipments included in this space")) + obj.addProperty("App::PropertyEnumeration","Conditioning", "Arch",QT_TRANSLATE_NOOP("App::Property","The type of air conditioning of this space")) self.Type = "Space" obj.SpaceType = SpaceTypes obj.Conditioning = ConditioningTypes @@ -385,16 +388,16 @@ class _ViewProviderSpace(ArchComponent.ViewProviderComponent): vobj.LineWidth = 1 vobj.LineColor = (1.0,0.0,0.0,1.0) vobj.DrawStyle = "Dotted" - vobj.addProperty("App::PropertyStringList", "Text", "Arch","The text to show. Use $area, $label, $tag, $floor, $walls, $ceiling to insert the respective data") - vobj.addProperty("App::PropertyString", "FontName", "Arch","The name of the font") - vobj.addProperty("App::PropertyColor", "TextColor", "Arch","The color of the area text") - vobj.addProperty("App::PropertyLength", "FontSize", "Arch","The size of the text font") - vobj.addProperty("App::PropertyLength", "FirstLine", "Arch","The size of the first line of text") - vobj.addProperty("App::PropertyFloat", "LineSpacing", "Arch","The space between the lines of text") - vobj.addProperty("App::PropertyVectorDistance","TextPosition","Arch","The position of the text. Leave (0,0,0) for automatic position") - vobj.addProperty("App::PropertyEnumeration", "TextAlign", "Arch","The justification of the text") - vobj.addProperty("App::PropertyInteger", "Decimals", "Arch","The number of decimals to use for calculated texts") - vobj.addProperty("App::PropertyBool", "ShowUnit", "Arch","Show the unit suffix") + vobj.addProperty("App::PropertyStringList", "Text", "Arch",QT_TRANSLATE_NOOP("App::Property","The text to show. Use $area, $label, $tag, $floor, $walls, $ceiling to insert the respective data")) + vobj.addProperty("App::PropertyString", "FontName", "Arch",QT_TRANSLATE_NOOP("App::Property","The name of the font")) + vobj.addProperty("App::PropertyColor", "TextColor", "Arch",QT_TRANSLATE_NOOP("App::Property","The color of the area text")) + vobj.addProperty("App::PropertyLength", "FontSize", "Arch",QT_TRANSLATE_NOOP("App::Property","The size of the text font")) + vobj.addProperty("App::PropertyLength", "FirstLine", "Arch",QT_TRANSLATE_NOOP("App::Property","The size of the first line of text")) + vobj.addProperty("App::PropertyFloat", "LineSpacing", "Arch",QT_TRANSLATE_NOOP("App::Property","The space between the lines of text")) + vobj.addProperty("App::PropertyVectorDistance","TextPosition","Arch",QT_TRANSLATE_NOOP("App::Property","The position of the text. Leave (0,0,0) for automatic position")) + vobj.addProperty("App::PropertyEnumeration", "TextAlign", "Arch",QT_TRANSLATE_NOOP("App::Property","The justification of the text")) + vobj.addProperty("App::PropertyInteger", "Decimals", "Arch",QT_TRANSLATE_NOOP("App::Property","The number of decimals to use for calculated texts")) + vobj.addProperty("App::PropertyBool", "ShowUnit", "Arch",QT_TRANSLATE_NOOP("App::Property","Show the unit suffix")) vobj.TextColor = (0.0,0.0,0.0,1.0) vobj.Text = ["$label","$area"] vobj.TextAlign = ["Left","Center","Right"] diff --git a/src/Mod/Arch/ArchStairs.py b/src/Mod/Arch/ArchStairs.py index 447cfea61..7eb13da77 100644 --- a/src/Mod/Arch/ArchStairs.py +++ b/src/Mod/Arch/ArchStairs.py @@ -31,9 +31,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt def makeStairs(baseobj=None,length=None,width=None,height=None,steps=None,name="Stairs"): @@ -68,9 +71,9 @@ class _CommandStairs: "the Arch Stairs command definition" def GetResources(self): return {'Pixmap' : 'Arch_Stairs', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Stairs","Stairs"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Stairs","Stairs"), 'Accel': "S, R", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Space","Creates a stairs object")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Space","Creates a stairs object")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -96,26 +99,26 @@ class _Stairs(ArchComponent.Component): # http://en.wikipedia.org/wiki/Stairs # base properties - obj.addProperty("App::PropertyLength","Length","Arch","The length of these stairs, if no baseline is defined") - obj.addProperty("App::PropertyLength","Width","Arch","The width of these stairs") - obj.addProperty("App::PropertyLength","Height","Arch","The total height of these stairs") - obj.addProperty("App::PropertyEnumeration","Align","Arch","The alignment of these stairs on their baseline, if applicable") + obj.addProperty("App::PropertyLength","Length","Arch",QT_TRANSLATE_NOOP("App::Property","The length of these stairs, if no baseline is defined")) + obj.addProperty("App::PropertyLength","Width","Arch",QT_TRANSLATE_NOOP("App::Property","The width of these stairs")) + obj.addProperty("App::PropertyLength","Height","Arch",QT_TRANSLATE_NOOP("App::Property","The total height of these stairs")) + obj.addProperty("App::PropertyEnumeration","Align","Arch",QT_TRANSLATE_NOOP("App::Property","The alignment of these stairs on their baseline, if applicable")) # steps properties - obj.addProperty("App::PropertyInteger","NumberOfSteps","Steps","The number of risers in these stairs") - obj.addProperty("App::PropertyLength","TreadDepth","Steps","The depth of the treads of these stairs") - obj.addProperty("App::PropertyLength","RiserHeight","Steps","The height of the risers of these stairs") - obj.addProperty("App::PropertyLength","Nosing","Steps","The size of the nosing") - obj.addProperty("App::PropertyLength","TreadThickness","Steps","The thickness of the treads") - obj.addProperty("App::PropertyFloat","BlondelRatio","Steps","The Blondel ratio, must be between 62 and 64cm or 24.5 and 25.5in") + obj.addProperty("App::PropertyInteger","NumberOfSteps","Steps",QT_TRANSLATE_NOOP("App::Property","The number of risers in these stairs")) + obj.addProperty("App::PropertyLength","TreadDepth","Steps",QT_TRANSLATE_NOOP("App::Property","The depth of the treads of these stairs")) + obj.addProperty("App::PropertyLength","RiserHeight","Steps",QT_TRANSLATE_NOOP("App::Property","The height of the risers of these stairs")) + obj.addProperty("App::PropertyLength","Nosing","Steps",QT_TRANSLATE_NOOP("App::Property","The size of the nosing")) + obj.addProperty("App::PropertyLength","TreadThickness","Steps",QT_TRANSLATE_NOOP("App::Property","The thickness of the treads")) + obj.addProperty("App::PropertyFloat","BlondelRatio","Steps",QT_TRANSLATE_NOOP("App::Property","The Blondel ratio, must be between 62 and 64cm or 24.5 and 25.5in")) # structural properties - obj.addProperty("App::PropertyEnumeration","Landings","Structure","The type of landings of these stairs") - obj.addProperty("App::PropertyEnumeration","Winders","Structure","The type of winders in these stairs") - obj.addProperty("App::PropertyEnumeration","Structure","Structure","The type of structure of these stairs") - obj.addProperty("App::PropertyLength","StructureThickness","Structure","The thickness of the massive structure or of the stringers") - obj.addProperty("App::PropertyLength","StringerWidth","Structure","The width of the stringers") - obj.addProperty("App::PropertyLength","StructureOffset","Structure","The offset between the border of the stairs and the structure") + obj.addProperty("App::PropertyEnumeration","Landings","Structure",QT_TRANSLATE_NOOP("App::Property","The type of landings of these stairs")) + obj.addProperty("App::PropertyEnumeration","Winders","Structure",QT_TRANSLATE_NOOP("App::Property","The type of winders in these stairs")) + obj.addProperty("App::PropertyEnumeration","Structure","Structure",QT_TRANSLATE_NOOP("App::Property","The type of structure of these stairs")) + obj.addProperty("App::PropertyLength","StructureThickness","Structure",QT_TRANSLATE_NOOP("App::Property","The thickness of the massive structure or of the stringers")) + obj.addProperty("App::PropertyLength","StringerWidth","Structure",QT_TRANSLATE_NOOP("App::Property","The width of the stringers")) + obj.addProperty("App::PropertyLength","StructureOffset","Structure",QT_TRANSLATE_NOOP("App::Property","The offset between the border of the stairs and the structure")) obj.Align = ['Left','Right','Center'] obj.Landings = ["None","At center","At each corner"] diff --git a/src/Mod/Arch/ArchStructure.py b/src/Mod/Arch/ArchStructure.py index d3eb6b7fb..ffc581329 100644 --- a/src/Mod/Arch/ArchStructure.py +++ b/src/Mod/Arch/ArchStructure.py @@ -30,9 +30,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Structure" __author__ = "Yorik van Havre" @@ -119,9 +122,9 @@ class _CommandStructure: "the Arch Structure command definition" def GetResources(self): return {'Pixmap' : 'Arch_Structure', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Structure","Structure"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Structure","Structure"), 'Accel': "S, T", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Structure","Creates a structure object from scratch or from a selected object (sketch, wire, face or solid)")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Structure","Creates a structure object from scratch or from a selected object (sketch, wire, face or solid)")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -374,14 +377,14 @@ class _Structure(ArchComponent.Component): "The Structure object" def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyLink","Tool","Arch","An optional extrusion path for this element") - obj.addProperty("App::PropertyLength","Length","Arch","The length of this element, if not based on a profile") - obj.addProperty("App::PropertyLength","Width","Arch","The width of this element, if not based on a profile") - obj.addProperty("App::PropertyLength","Height","Arch","The height or extrusion depth of this element. Keep 0 for automatic") - obj.addProperty("App::PropertyLinkList","Armatures","Arch","Armatures contained in this element") - obj.addProperty("App::PropertyVector","Normal","Arch","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)") - obj.addProperty("App::PropertyVectorList","Nodes","Arch","The structural nodes of this element") - obj.addProperty("App::PropertyString","Profile","Arch","A description of the standard profile this element is based upon") + obj.addProperty("App::PropertyLink","Tool","Arch",QT_TRANSLATE_NOOP("App::Property","An optional extrusion path for this element")) + obj.addProperty("App::PropertyLength","Length","Arch",QT_TRANSLATE_NOOP("App::Property","The length of this element, if not based on a profile")) + obj.addProperty("App::PropertyLength","Width","Arch",QT_TRANSLATE_NOOP("App::Property","The width of this element, if not based on a profile")) + obj.addProperty("App::PropertyLength","Height","Arch",QT_TRANSLATE_NOOP("App::Property","The height or extrusion depth of this element. Keep 0 for automatic")) + obj.addProperty("App::PropertyLinkList","Armatures","Arch",QT_TRANSLATE_NOOP("App::Property","Armatures contained in this element")) + obj.addProperty("App::PropertyVector","Normal","Arch",QT_TRANSLATE_NOOP("App::Property","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)")) + obj.addProperty("App::PropertyVectorList","Nodes","Arch",QT_TRANSLATE_NOOP("App::Property","The structural nodes of this element")) + obj.addProperty("App::PropertyString","Profile","Arch",QT_TRANSLATE_NOOP("App::Property","A description of the standard profile this element is based upon")) self.Type = "Structure" obj.Role = Roles @@ -494,10 +497,10 @@ class _ViewProviderStructure(ArchComponent.ViewProviderComponent): def __init__(self,vobj): ArchComponent.ViewProviderComponent.__init__(self,vobj) - vobj.addProperty("App::PropertyBool","ShowNodes","Arch","If the nodes are visible or not").ShowNodes = False - vobj.addProperty("App::PropertyFloat","NodeLine","Base","The width of the nodes line") - vobj.addProperty("App::PropertyFloat","NodeSize","Base","The size of the node points") - vobj.addProperty("App::PropertyColor","NodeColor","Base","The color of the nodes line") + vobj.addProperty("App::PropertyBool","ShowNodes","Arch",QT_TRANSLATE_NOOP("App::Property","If the nodes are visible or not")).ShowNodes = False + vobj.addProperty("App::PropertyFloat","NodeLine","Base",QT_TRANSLATE_NOOP("App::Property","The width of the nodes line")) + vobj.addProperty("App::PropertyFloat","NodeSize","Base",QT_TRANSLATE_NOOP("App::Property","The size of the node points")) + vobj.addProperty("App::PropertyColor","NodeColor","Base",QT_TRANSLATE_NOOP("App::Property","The color of the nodes line")) vobj.NodeColor = (1.0,1.0,1.0,1.0) vobj.NodeSize = 6 vobj.ShapeColor = ArchCommands.getDefaultColor("Structure") @@ -566,9 +569,9 @@ class _StructuralSystem(ArchComponent.Component): "The Structural System object" def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyLinkList","Axes","Arch","Axes systems this structure is built on") - obj.addProperty("App::PropertyIntegerList","Exclude","Arch","The element numbers to exclude when this structure is based on axes") - obj.addProperty("App::PropertyBool","Align","Arch","If true the element are aligned with axes").Align = False + obj.addProperty("App::PropertyLinkList","Axes","Arch",QT_TRANSLATE_NOOP("App::Property","Axes systems this structure is built on")) + obj.addProperty("App::PropertyIntegerList","Exclude","Arch",QT_TRANSLATE_NOOP("App::Property","The element numbers to exclude when this structure is based on axes")) + obj.addProperty("App::PropertyBool","Align","Arch",QT_TRANSLATE_NOOP("App::Property","If true the element are aligned with axes")).Align = False self.Type = "StructuralSystem" def execute(self,obj): diff --git a/src/Mod/Arch/ArchWall.py b/src/Mod/Arch/ArchWall.py index 277481dd3..2aac7bfc6 100644 --- a/src/Mod/Arch/ArchWall.py +++ b/src/Mod/Arch/ArchWall.py @@ -27,9 +27,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Wall" __author__ = "Yorik van Havre" @@ -151,9 +154,9 @@ class _CommandWall: "the Arch Wall command definition" def GetResources(self): return {'Pixmap' : 'Arch_Wall', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Wall","Wall"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Wall","Wall"), 'Accel': "W, A", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Wall","Creates a wall object from scratch or from a selected object (wire, face or solid)")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Wall","Creates a wall object from scratch or from a selected object (wire, face or solid)")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -366,8 +369,8 @@ class _CommandMergeWalls: "the Arch Merge Walls command definition" def GetResources(self): return {'Pixmap' : 'Arch_MergeWalls', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_MergeWalls","Merge Walls"), - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_MergeWalls","Merges the selected walls, if possible")} + 'MenuText': QT_TRANSLATE_NOOP("Arch_MergeWalls","Merge Walls"), + 'ToolTip': QT_TRANSLATE_NOOP("Arch_MergeWalls","Merges the selected walls, if possible")} def IsActive(self): return bool(FreeCADGui.Selection.getSelection()) @@ -408,13 +411,13 @@ class _Wall(ArchComponent.Component): "The Wall object" def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyLength","Length","Arch","The length of this wall. Not used if this wall is based on an underlying object") - obj.addProperty("App::PropertyLength","Width","Arch","The width of this wall. Not used if this wall is based on a face") - obj.addProperty("App::PropertyLength","Height","Arch","The height of this wall. Keep 0 for automatic. Not used if this wall is based on a solid") - obj.addProperty("App::PropertyEnumeration","Align","Arch","The alignment of this wall on its base object, if applicable") - obj.addProperty("App::PropertyVector","Normal","Arch","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)") - obj.addProperty("App::PropertyInteger","Face","Arch","The face number of the base object used to build this wall") - obj.addProperty("App::PropertyDistance","Offset","Arch","The offset between this wall and its baseline (only for left and right alignments)") + obj.addProperty("App::PropertyLength","Length","Arch",QT_TRANSLATE_NOOP("App::Property","The length of this wall. Not used if this wall is based on an underlying object")) + obj.addProperty("App::PropertyLength","Width","Arch",QT_TRANSLATE_NOOP("App::Property","The width of this wall. Not used if this wall is based on a face")) + obj.addProperty("App::PropertyLength","Height","Arch",QT_TRANSLATE_NOOP("App::Property","The height of this wall. Keep 0 for automatic. Not used if this wall is based on a solid")) + obj.addProperty("App::PropertyEnumeration","Align","Arch",QT_TRANSLATE_NOOP("App::Property","The alignment of this wall on its base object, if applicable")) + obj.addProperty("App::PropertyVector","Normal","Arch",QT_TRANSLATE_NOOP("App::Property","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)")) + obj.addProperty("App::PropertyInteger","Face","Arch",QT_TRANSLATE_NOOP("App::Property","The face number of the base object used to build this wall")) + obj.addProperty("App::PropertyDistance","Offset","Arch",QT_TRANSLATE_NOOP("App::Property","The offset between this wall and its baseline (only for left and right alignments)")) obj.Align = ['Left','Right','Center'] obj.Role = Roles self.Type = "Wall" diff --git a/src/Mod/Arch/ArchWindow.py b/src/Mod/Arch/ArchWindow.py index 593d905b0..fd4df2fdc 100644 --- a/src/Mod/Arch/ArchWindow.py +++ b/src/Mod/Arch/ArchWindow.py @@ -27,9 +27,12 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui, QtSvg from DraftTools import translate + from PySide.QtCore import QT_TRANSLATE_NOOP else: def translate(ctxt,txt): return txt + def QT_TRANSLATE_NOOP(ctxt,txt): + return txt __title__="FreeCAD Window" __author__ = "Yorik van Havre" @@ -383,9 +386,9 @@ class _CommandWindow: def GetResources(self): return {'Pixmap' : 'Arch_Window', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Window","Window"), + 'MenuText': QT_TRANSLATE_NOOP("Arch_Window","Window"), 'Accel': "W, N", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Window","Creates a window object from a selected object (wire, rectangle or sketch)")} + 'ToolTip': QT_TRANSLATE_NOOP("Arch_Window","Creates a window object from a selected object (wire, rectangle or sketch)")} def IsActive(self): return not FreeCAD.ActiveDocument is None @@ -622,15 +625,15 @@ class _Window(ArchComponent.Component): "The Window object" def __init__(self,obj): ArchComponent.Component.__init__(self,obj) - obj.addProperty("App::PropertyStringList","WindowParts","Arch","the components of this window") - obj.addProperty("App::PropertyLength","HoleDepth","Arch","The depth of the hole that this window makes in its host object. Keep 0 for automatic.") - obj.addProperty("App::PropertyLink","Subvolume","Arch","an optional object that defines a volume to be subtracted from hosts of this window") - obj.addProperty("App::PropertyLength","Width","Arch","The width of this window (for preset windows only)") - obj.addProperty("App::PropertyLength","Height","Arch","The height of this window (for preset windows only)") - obj.addProperty("App::PropertyVector","Normal","Arch","The normal direction of this window") + obj.addProperty("App::PropertyStringList","WindowParts","Arch",QT_TRANSLATE_NOOP("App::Property","the components of this window")) + obj.addProperty("App::PropertyLength","HoleDepth","Arch",QT_TRANSLATE_NOOP("App::Property","The depth of the hole that this window makes in its host object. Keep 0 for automatic.")) + obj.addProperty("App::PropertyLink","Subvolume","Arch",QT_TRANSLATE_NOOP("App::Property","an optional object that defines a volume to be subtracted from hosts of this window")) + obj.addProperty("App::PropertyLength","Width","Arch",QT_TRANSLATE_NOOP("App::Property","The width of this window (for preset windows only)")) + obj.addProperty("App::PropertyLength","Height","Arch",QT_TRANSLATE_NOOP("App::Property","The height of this window (for preset windows only)")) + obj.addProperty("App::PropertyVector","Normal","Arch",QT_TRANSLATE_NOOP("App::Property","The normal direction of this window")) obj.addProperty("App::PropertyInteger","Preset","Arch","") - obj.addProperty("App::PropertyLink","PanelMaterial","Material","A material for this object") - obj.addProperty("App::PropertyLink","GlassMaterial","Material","A material for this object") + obj.addProperty("App::PropertyLink","PanelMaterial","Material",QT_TRANSLATE_NOOP("App::Property","A material for this object")) + obj.addProperty("App::PropertyLink","GlassMaterial","Material",QT_TRANSLATE_NOOP("App::Property","A material for this object")) obj.setEditorMode("Preset",2) self.Type = "Window" diff --git a/src/Mod/Arch/InitGui.py b/src/Mod/Arch/InitGui.py index 1e9c0fb94..f86c3314a 100644 --- a/src/Mod/Arch/InitGui.py +++ b/src/Mod/Arch/InitGui.py @@ -74,8 +74,8 @@ class ArchWorkbench(Workbench): self.appendToolbar(QT_TRANSLATE_NOOP("Workbench","Arch tools"),self.archtools) self.appendToolbar(QT_TRANSLATE_NOOP("Workbench","Draft tools"),self.drafttools) self.appendToolbar(QT_TRANSLATE_NOOP("Workbench","Draft mod tools"),self.draftmodtools) - self.appendMenu([translate("arch","&Architecture"),translate("arch","Utilities")],self.utilities) - self.appendMenu(translate("arch","&Architecture"),self.archtools) + self.appendMenu([translate("arch","&Arch"),translate("arch","Utilities")],self.utilities) + self.appendMenu(translate("arch","&Arch"),self.archtools) self.appendMenu(translate("arch","&Draft"),self.drafttools+self.draftmodtools+self.draftextratools) self.appendMenu([translate("arch","&Draft"),translate("arch","Utilities")],self.draftutils+self.draftcontexttools) self.appendMenu([translate("arch","&Draft"),translate("arch","Snapping")],self.snapList)