Arch: move \n out of translation strings

This commit is contained in:
luz.paz
2018-02-11 08:38:53 -05:00
committed by wmayer
parent e510c7540c
commit de0ca700d5
8 changed files with 32 additions and 32 deletions

View File

@@ -128,7 +128,7 @@ class _CommandAxisSystem:
s = "["
for o in FreeCADGui.Selection.getSelection():
if Draft.getType(o) != "Axis":
FreeCAD.Console.PrintError(translate("Arch","Only axes must be selected\n"))
FreeCAD.Console.PrintError(translate("Arch","Only axes must be selected")+"\n")
return
s += "FreeCAD.ActiveDocument."+o.Name+","
s += "]"
@@ -137,7 +137,7 @@ class _CommandAxisSystem:
FreeCADGui.doCommand("Arch.makeAxisSystem("+s+")")
FreeCAD.ActiveDocument.commitTransaction()
else:
FreeCAD.Console.PrintError(translate("Arch","Please select at least one axis\n"))
FreeCAD.Console.PrintError(translate("Arch","Please select at least one axis")+"\n")
def IsActive(self):
return not FreeCAD.ActiveDocument is None

View File

@@ -152,12 +152,12 @@ class _CommandPipeConnector:
import Draft
s = FreeCADGui.Selection.getSelection()
if not (len(s) in [2,3]):
FreeCAD.Console.PrintError(translate("Arch","Please select exactly 2 or 3 Pipe objects\n"))
FreeCAD.Console.PrintError(translate("Arch","Please select exactly 2 or 3 Pipe objects")+"\n")
return
o = "["
for obj in s:
if Draft.getType(obj) != "Pipe":
FreeCAD.Console.PrintError(translate("Arch","Please select only Pipe objects\n"))
FreeCAD.Console.PrintError(translate("Arch","Please select only Pipe objects")+"\n")
return
o += "FreeCAD.ActiveDocument."+obj.Name+","
o += "]"
@@ -192,7 +192,7 @@ class _ArchPipe(ArchComponent.Component):
pl = obj.Placement
w = self.getWire(obj)
if not w:
FreeCAD.Console.PrintError(translate("Arch","Unable to build the base path\n"))
FreeCAD.Console.PrintError(translate("Arch","Unable to build the base path")+"\n")
return
if obj.OffsetStart.Value:
e = w.Edges[0]
@@ -208,7 +208,7 @@ class _ArchPipe(ArchComponent.Component):
w = Part.Wire(w.Edges[:-1]+[e])
p = self.getProfile(obj)
if not p:
FreeCAD.Console.PrintError(translate("Arch","Unable to build the profile\n"))
FreeCAD.Console.PrintError(translate("Arch","Unable to build the profile")+"\n")
return
# move and rotate the profile to the first point
delta = w.Vertexes[0].Point-p.CenterOfMass
@@ -220,7 +220,7 @@ class _ArchPipe(ArchComponent.Component):
try:
sh = w.makePipeShell([p],True,False,2)
except:
FreeCAD.Console.PrintError(translate("Arch","Unable to build the pipe\n"))
FreeCAD.Console.PrintError(translate("Arch","Unable to build the pipe")+"\n")
else:
obj.Shape = sh
if obj.Base:
@@ -233,13 +233,13 @@ class _ArchPipe(ArchComponent.Component):
import Part
if obj.Base:
if not obj.Base.isDerivedFrom("Part::Feature"):
FreeCAD.Console.PrintError(translate("Arch","The base object is not a Part\n"))
FreeCAD.Console.PrintError(translate("Arch","The base object is not a Part")+"\n")
return
if len(obj.Base.Shape.Wires) != 1:
FreeCAD.Console.PrintError(translate("Arch","Too many wires in the base shape\n"))
FreeCAD.Console.PrintError(translate("Arch","Too many wires in the base shape")+"\n")
return
if obj.Base.Shape.Wires[0].isClosed():
FreeCAD.Console.PrintError(translate("Arch","The base wire is closed\n"))
FreeCAD.Console.PrintError(translate("Arch","The base wire is closed")+"\n")
return
w = obj.Base.Shape.Wires[0]
else:
@@ -253,13 +253,13 @@ class _ArchPipe(ArchComponent.Component):
import Part
if obj.Profile:
if not obj.Profile.isDerivedFrom("Part::Part2DObject"):
FreeCAD.Console.PrintError(translate("Arch","The profile is not a 2D Part\n"))
FreeCAD.Console.PrintError(translate("Arch","The profile is not a 2D Part")+"\n")
return
if len(obj.Profile.Shape.Wires) != 1:
FreeCAD.Console.PrintError(translate("Arch","Too many wires in the profile\n"))
FreeCAD.Console.PrintError(translate("Arch","Too many wires in the profile")+"\n")
return
if not obj.Profile.Shape.Wires[0].isClosed():
FreeCAD.Console.PrintError(translate("Arch","The profile is not closed\n"))
FreeCAD.Console.PrintError(translate("Arch","The profile is not closed")+"\n")
return
p = obj.Profile.Shape.Wires[0]
else:
@@ -309,7 +309,7 @@ class _ArchPipeConnector(ArchComponent.Component):
if len(obj.Pipes) < 2:
return
if len(obj.Pipes) > 3:
FreeCAD.Console.PrintWarning(translate("Arch","Only the 3 first wires will be connected\n"))
FreeCAD.Console.PrintWarning(translate("Arch","Only the 3 first wires will be connected")+"\n")
if obj.Radius.Value == 0:
return
wires = []
@@ -329,7 +329,7 @@ class _ArchPipeConnector(ArchComponent.Component):
order = ["end","start"]
point = wires[0].Vertexes[-1].Point
else:
FreeCAD.Console.PrintError(translate("Arch","Common vertex not found\n"))
FreeCAD.Console.PrintError(translate("Arch","Common vertex not found")+"\n")
return
if order[0] == "start":
v1 = wires[0].Vertexes[1].Point.sub(wires[0].Vertexes[0].Point).normalize()
@@ -345,7 +345,7 @@ class _ArchPipeConnector(ArchComponent.Component):
if obj.ConnectorType != "Corner":
obj.ConnectorType = "Corner"
if round(v1.getAngle(v2),tol) in [0,round(math.pi,tol)]:
FreeCAD.Console.PrintError(translate("Arch","Pipes are already aligned\n"))
FreeCAD.Console.PrintError(translate("Arch","Pipes are already aligned")+"\n")
return
normal = v2.cross(v1)
offset = math.tan(math.pi/2-v1.getAngle(v2)/2)*obj.Radius.Value
@@ -373,7 +373,7 @@ class _ArchPipeConnector(ArchComponent.Component):
elif wires[0].Vertexes[-1].Point == point:
order.append("end")
else:
FreeCAD.Console.PrintError(translate("Arch","Common vertex not found\n"))
FreeCAD.Console.PrintError(translate("Arch","Common vertex not found")+"\n")
if order[2] == "start":
v3 = wires[2].Vertexes[1].Point.sub(wires[2].Vertexes[0].Point).normalize()
else:
@@ -385,7 +385,7 @@ class _ArchPipeConnector(ArchComponent.Component):
elif round(v2.getAngle(v3),tol) in [0,round(math.pi,tol)]:
pair = [v2,v3,v1]
else:
FreeCAD.Console.PrintError(translate("Arch","At least 2 pipes must aligned\n"))
FreeCAD.Console.PrintError(translate("Arch","At least 2 pipes must aligned")+"\n")
return
offset = obj.Radius.Value
v1.multiply(offset)

View File

@@ -97,7 +97,7 @@ class _ArchSchedule:
# silently fail on old schedule objects
return
if not obj.Result:
FreeCAD.Console.PrintError(translate("Arch","No spreadsheet attached to this schedule\n"))
FreeCAD.Console.PrintError(translate("Arch","No spreadsheet attached to this schedule")+"\n")
return
obj.Result.clearAll()
obj.Result.set("A1","Description")

View File

@@ -1440,7 +1440,7 @@ class _ArchWindowTaskPanel:
self.obj.WindowParts = parts
self.update()
else:
FreeCAD.Console.PrintWarning(translate("Arch", "Unable to create component\n"))
FreeCAD.Console.PrintWarning(translate("Arch", "Unable to create component")+"\n")
self.newtitle.setVisible(False)
self.new1.setVisible(False)

View File

@@ -49,7 +49,7 @@ def checkCollada():
try:
import collada
except ImportError:
FreeCAD.Console.PrintError(translate("Arch","pycollada not found, collada support is disabled.\n"))
FreeCAD.Console.PrintError(translate("Arch","pycollada not found, collada support is disabled.")+"\n")
return False
else:
return True

View File

@@ -44,11 +44,11 @@ else:
def export(objectslist,filename):
if len(objectslist) != 1:
FreeCAD.Console.PrintError(translate("Arch","This exporter can currently only export one site object\n"))
FreeCAD.Console.PrintError(translate("Arch","This exporter can currently only export one site object")+"\n")
return
site = objectslist[0]
if Draft.getType(site) != "Site":
FreeCAD.Console.PrintError(translate("Arch","This exporter can currently only export one site object\n"))
FreeCAD.Console.PrintError(translate("Arch","This exporter can currently only export one site object")+"\n")
return
filestream = pyopen(filename,"wb")
@@ -89,7 +89,7 @@ def export(objectslist,filename):
# spaces
for space in Draft.getObjectsOfType(Draft.getGroupContents(building.Group,addgroups=True),"Space"):
if not space.Zone:
FreeCAD.Console.PrintError(translate("Arch","Error: Space '%s' has no Zone. Aborting.\n") % space.Label)
FreeCAD.Console.PrintError(translate("Arch","Error: Space '%s' has no Zone. Aborting.")+ "\n" + % space.Label)
return
filestream.write( ' <Space id="%s" spaceType="%s" zoneIdRef="%s" conditionType="%f">\n' % (space.Name, space.SpaceType, space.Zone.Name, space.Conditioning) )
#filestream.write( ' <CADObjectId>%s</CADObjectId>\n' % space.Name ) # not sure what this is used for?

View File

@@ -389,13 +389,13 @@ def read(filename,skip=None):
else:
# use only the internal python parser
FreeCAD.Console.PrintWarning(translate("Arch","IfcOpenShell not found or disabled, falling back on internal parser.\n"))
FreeCAD.Console.PrintWarning(translate("Arch","IfcOpenShell not found or disabled, falling back on internal parser.")+"\n")
schema=getSchema()
if schema:
if DEBUG: print("opening",filename,"...")
ifc = IfcDocument(filename,schema=schema)
else:
FreeCAD.Console.PrintWarning(translate("Arch","IFC Schema not found, IFC import disabled.\n"))
FreeCAD.Console.PrintWarning(translate("Arch","IFC Schema not found, IFC import disabled.")+"\n")
return None
t2 = time.time()
if DEBUG: print("Successfully loaded",ifc,"in %s s" % ((t2-t1)))
@@ -820,7 +820,7 @@ def decode(name):
try:
decodedName = (name.decode("latin1"))
except UnicodeDecodeError:
FreeCAD.Console.PrintError(translate("Arch", "Error: Couldn't determine character encoding\n"))
FreeCAD.Console.PrintError(translate("Arch", "Error: Couldn't determine character encoding")+"\n")
decodedName = name
return decodedName
@@ -942,14 +942,14 @@ def export(exportList,filename):
try:
import ifc_wrapper as ifcw
except ImportError:
FreeCAD.Console.PrintError(translate("Arch","Error: IfcOpenShell is not installed\n"))
FreeCAD.Console.PrintError(translate("Arch","Error: IfcOpenShell is not installed")+"\n")
print("""importIFC: ifcOpenShell is not installed. IFC export is unavailable.
Note: IFC export currently requires an experimental version of IfcOpenShell
available from https://github.com/aothms/IfcOpenShell""")
return
if (not hasattr(ifcw,"IfcFile")) and (not hasattr(ifcw,"file")):
FreeCAD.Console.PrintError(translate("Arch","Error: your IfcOpenShell version is too old\n"))
FreeCAD.Console.PrintError(translate("Arch","Error: your IfcOpenShell version is too old")+"\n")
print("""importIFC: The version of ifcOpenShell installed on this system doesn't
have IFC export capabilities. IFC export currently requires an experimental
version of IfcOpenShell available from https://github.com/aothms/IfcOpenShell""")

View File

@@ -64,11 +64,11 @@ def getIndices(shape,offset):
if not isinstance(e.Curve,Part.LineSegment):
if not curves:
curves = shape.tessellate(1)
FreeCAD.Console.PrintWarning(translate("Arch","Found a shape containing curves, triangulating\n").decode('utf8'))
FreeCAD.Console.PrintWarning(translate("Arch","Found a shape containing curves, triangulating").decode('utf8')+"\n")
break
except: # unimplemented curve type
curves = shape.tessellate(1)
FreeCAD.Console.PrintWarning(translate("Arch","Found a shape containing curves, triangulating\n").decode('utf8'))
FreeCAD.Console.PrintWarning(translate("Arch","Found a shape containing curves, triangulating").decode('utf8')+"\n")
break
elif isinstance(shape,Mesh.Mesh):
curves = shape.Topology
@@ -185,7 +185,7 @@ def export(exportList,filename):
for f in flist:
outfile.write("f" + f + "\n")
outfile.close()
FreeCAD.Console.PrintMessage(translate("Arch","successfully written ").decode('utf8')+filename+"\n")
FreeCAD.Console.PrintMessage(translate("Arch","successfully written ").decode('utf8') + filename + "\n")
if materials:
outfile = pythonopen(filenamemtl,"wb")
outfile.write("# FreeCAD v" + ver[0] + "." + ver[1] + " build" + ver[2] + " Arch module\n")