Merge pull request #5132 from luzpaz/Draft-whitespace

Draft: Fix superfluous whitespace in translations + misc. typos
This commit is contained in:
Chris Hennes
2021-10-30 22:10:27 -05:00
committed by GitHub
4 changed files with 20 additions and 16 deletions

View File

@@ -652,14 +652,14 @@ class Plane:
if not geom_is_shape:
FreeCAD.Console.PrintError(translate(
"draft",
"Object without Part.Shape geometry:'{}'\n".format(
obj.ObjectName)))
"Object without Part.Shape geometry:'{}'".format(
obj.ObjectName)) + "\n")
return False
if geom.isNull():
FreeCAD.Console.PrintError(translate(
"draft",
"Object with null Part.Shape geometry:'{}'\n".format(
obj.ObjectName)))
"Object with null Part.Shape geometry:'{}'".format(
obj.ObjectName)) + "\n")
return False
if obj.HasSubObjects:
shapes.extend(obj.SubObjects)
@@ -672,7 +672,7 @@ class Plane:
for n in range(len(shapes)):
if not DraftGeomUtils.is_planar(shapes[n]):
FreeCAD.Console.PrintError(translate(
"draft","'{}' object is not planar\n".format(names[n])))
"draft", "'{}' object is not planar".format(names[n])) + "\n")
return False
if not normal:
normal = DraftGeomUtils.get_normal(shapes[n])
@@ -683,8 +683,8 @@ class Plane:
for n in range(len(shapes)):
if not DraftGeomUtils.are_coplanar(shapes[shape_ref], shapes[n]):
FreeCAD.Console.PrintError(translate(
"draft","{} and {} aren't coplanar\n".format(
names[shape_ref],names[n])))
"draft", "{} and {} aren't coplanar".format(
names[shape_ref],names[n])) + "\n")
return False
else:
# suppose all geometries are straight lines or points
@@ -693,7 +693,7 @@ class Plane:
poly = Part.makePolygon(points)
if not DraftGeomUtils.is_planar(poly):
FreeCAD.Console.PrintError(translate(
"draft","All Shapes must be coplanar\n"))
"draft", "All Shapes must be coplanar") + "\n")
return False
normal = DraftGeomUtils.get_normal(poly)
else:
@@ -701,7 +701,7 @@ class Plane:
if not normal:
FreeCAD.Console.PrintError(translate(
"draft","Selected Shapes must define a plane\n"))
"draft", "Selected Shapes must define a plane") + "\n")
return False
# set center of mass

View File

@@ -100,13 +100,15 @@ def make_sketch(objects_list, autoconstraints=False, addTo=None,
if isinstance(obj,Part.Shape):
shape = obj
elif not hasattr(obj,'Shape'):
App.Console.PrintError(translate("draft","No shape found\n"))
App.Console.PrintError(translate("draft",
"No shape found")+"\n")
return None
else:
shape = obj.Shape
if not DraftGeomUtils.is_planar(shape, tol):
App.Console.PrintError(translate("draft","All Shapes must be planar\n"))
App.Console.PrintError(translate("draft",
"All Shapes must be planar")+"\n")
return None
if DraftGeomUtils.get_normal(shape, tol):
@@ -121,7 +123,8 @@ def make_sketch(objects_list, autoconstraints=False, addTo=None,
if len(shape_norm_yes) >= 1:
for shape in shapes_list[1:]:
if not DraftGeomUtils.are_coplanar(shapes_list[0], shape, tol):
App.Console.PrintError(translate("draft","All Shapes must be coplanar\n"))
App.Console.PrintError(translate("draft",
"All Shapes must be coplanar")+"\n")
return None
# define sketch normal
normal = DraftGeomUtils.get_normal(shapes_list[0], tol)
@@ -132,7 +135,8 @@ def make_sketch(objects_list, autoconstraints=False, addTo=None,
if len(points) >= 2:
poly = Part.makePolygon(points)
if not DraftGeomUtils.is_planar(poly, tol):
App.Console.PrintError(translate("draft","All Shapes must be coplanar\n"))
App.Console.PrintError(translate("draft",
"All Shapes must be coplanar")+"\n")
return None
normal = DraftGeomUtils.get_normal(poly, tol)
if not normal:

View File

@@ -287,7 +287,7 @@ class Array(DraftLink):
_tip = QT_TRANSLATE_NOOP("App::Property",
"A parameter that determines "
"how many symmetry planes "
" the circular array will have.")
"the circular array will have.")
obj.addProperty("App::PropertyInteger",
"Symmetry",
"Circular array",
@@ -380,7 +380,7 @@ class Array(DraftLink):
obj.setPropertyStatus(pr, "Hidden")
def execute(self, obj):
"""Execture when the object is created or recomputed."""
"""Execute when the object is created or recomputed."""
if not obj.Base:
return

View File

@@ -163,7 +163,7 @@ class DimensionBase(DraftAnnotation):
"There are various possibilities:\n"
"- An object, and one of its edges.\n"
"- An object, and two of its vertices.\n"
"- An arc object, and its edge.\n")
"- An arc object, and its edge.")
obj.addProperty("App::PropertyLinkSubList",
"LinkedGeometry",
"Dimension",