Fixed translation system in Arch & Draft

This commit is contained in:
Yorik van Havre
2014-01-07 11:17:31 -02:00
parent 0e74bbb39e
commit b3fc7b7a78
24 changed files with 173 additions and 173 deletions

View File

@@ -281,7 +281,7 @@ Presets = [None,
]
def makeStructure(baseobj=None,length=0,width=0,height=0,name=str(translate("Arch","Structure"))):
def makeStructure(baseobj=None,length=0,width=0,height=0,name=translate("Arch","Structure")):
'''makeStructure([obj],[length],[width],[heigth],[swap]): creates a
structure element based on the given profile object and the given
extrusion height. If no base object is given, you can also specify
@@ -406,13 +406,13 @@ class _CommandStructure:
"sets up a taskbox widget"
d = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt("Decimals",2)
w = QtGui.QWidget()
w.setWindowTitle(unicode(translate("Arch","Structure options")))
w.setWindowTitle(translate("Arch","Structure options").decode("utf8"))
lay0 = QtGui.QVBoxLayout(w)
# presets box
layp = QtGui.QHBoxLayout()
lay0.addLayout(layp)
labelp = QtGui.QLabel(unicode(translate("Arch","Preset")))
labelp = QtGui.QLabel(translate("Arch","Preset").decode("utf8"))
layp.addWidget(labelp)
valuep = QtGui.QComboBox()
fpresets = [" "]
@@ -424,7 +424,7 @@ class _CommandStructure:
# length
lay1 = QtGui.QHBoxLayout()
lay0.addLayout(lay1)
label1 = QtGui.QLabel(unicode(translate("Arch","Length")))
label1 = QtGui.QLabel(translate("Arch","Length").decode("utf8"))
lay1.addWidget(label1)
self.vLength = QtGui.QDoubleSpinBox()
self.vLength.setDecimals(d)
@@ -435,7 +435,7 @@ class _CommandStructure:
# width
lay2 = QtGui.QHBoxLayout()
lay0.addLayout(lay2)
label2 = QtGui.QLabel(unicode(translate("Arch","Width")))
label2 = QtGui.QLabel(translate("Arch","Width").decode("utf8"))
lay2.addWidget(label2)
self.vWidth = QtGui.QDoubleSpinBox()
self.vWidth.setDecimals(d)
@@ -446,7 +446,7 @@ class _CommandStructure:
# height
lay3 = QtGui.QHBoxLayout()
lay0.addLayout(lay3)
label3 = QtGui.QLabel(unicode(translate("Arch","Height")))
label3 = QtGui.QLabel(translate("Arch","Height").decode("utf8"))
lay3.addWidget(label3)
self.vHeight = QtGui.QDoubleSpinBox()
self.vHeight.setDecimals(d)
@@ -455,11 +455,11 @@ class _CommandStructure:
lay3.addWidget(self.vHeight)
# horizontal button
value5 = QtGui.QPushButton(unicode(translate("Arch","Rotate")))
value5 = QtGui.QPushButton(translate("Arch","Rotate").decode("utf8"))
lay0.addWidget(value5)
# continue button
value4 = QtGui.QCheckBox(unicode(translate("Arch","Continue")))
value4 = QtGui.QCheckBox(translate("Arch","Continue").decode("utf8"))
lay0.addWidget(value4)
QtCore.QObject.connect(valuep,QtCore.SIGNAL("currentIndexChanged(int)"),self.setPreset)
@@ -515,25 +515,25 @@ class _Structure(ArchComponent.Component):
def __init__(self,obj):
ArchComponent.Component.__init__(self,obj)
obj.addProperty("App::PropertyLink","Tool","Arch",
"An optional extrusion path for this element")
translate("Arch","An optional extrusion path for this element"))
obj.addProperty("App::PropertyLength","Length","Arch",
str(translate("Arch","The length of this element, if not based on a profile")))
translate("Arch","The length of this element, if not based on a profile"))
obj.addProperty("App::PropertyLength","Width","Arch",
str(translate("Arch","The width of this element, if not based on a profile")))
translate("Arch","The width of this element, if not based on a profile"))
obj.addProperty("App::PropertyLength","Height","Arch",
str(translate("Arch","The height or extrusion depth of this element. Keep 0 for automatic")))
translate("Arch","The height or extrusion depth of this element. Keep 0 for automatic"))
obj.addProperty("App::PropertyLinkList","Axes","Arch",
str(translate("Arch","Axes systems this structure is built on")))
translate("Arch","Axes systems this structure is built on"))
obj.addProperty("App::PropertyLinkList","Armatures","Arch",
str(translate("Arch","Armatures contained in this element")))
translate("Arch","Armatures contained in this element"))
obj.addProperty("App::PropertyVector","Normal","Arch",
str(translate("Arch","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)")))
translate("Arch","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)"))
obj.addProperty("App::PropertyIntegerList","Exclude","Arch",
str(translate("Arch","The element numbers to exclude when this structure is based on axes")))
translate("Arch","The element numbers to exclude when this structure is based on axes"))
obj.addProperty("App::PropertyEnumeration","Role","Arch",
str(translate("Arch","The role of this structural element")))
translate("Arch","The role of this structural element"))
obj.addProperty("App::PropertyVectorList","Nodes","Arch",
str(translate("Arch","The structural nodes of this element")))
translate("Arch","The structural nodes of this element"))
self.Type = "Structure"
obj.Length = 1
obj.Width = 1
@@ -567,7 +567,7 @@ class _Structure(ArchComponent.Component):
try:
base = obj.Tool.Shape.copy().makePipe(obj.Base.Shape.copy())
except:
FreeCAD.Console.PrintError(str(translate("Arch","Error: The base shape couldn't be extruded along this tool object")))
FreeCAD.Console.PrintError(translate("Arch","Error: The base shape couldn't be extruded along this tool object"))
return
if not base:
if obj.Normal == Vector(0,0,0):
@@ -651,7 +651,7 @@ class _Structure(ArchComponent.Component):
if base.Volume < 0:
base.reverse()
if base.Volume < 0:
FreeCAD.Console.PrintError(str(translate("Arch","Couldn't compute a shape")))
FreeCAD.Console.PrintError(translate("Arch","Couldn't compute a shape"))
return
base = base.removeSplitter()
obj.Shape = base