diff options
Diffstat (limited to 'lib/extensions/base.py')
| -rw-r--r-- | lib/extensions/base.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/lib/extensions/base.py b/lib/extensions/base.py index 6b846aeb..440a5413 100644 --- a/lib/extensions/base.py +++ b/lib/extensions/base.py @@ -1,8 +1,8 @@ from collections import MutableMapping from copy import deepcopy import json -import re import os +import re import inkex from stringcase import snakecase @@ -10,6 +10,7 @@ from stringcase import snakecase from ..commands import layer_commands from ..elements import EmbroideryElement, nodes_to_elements from ..i18n import _ +from ..svg import generate_unique_id from ..svg.tags import SVG_GROUP_TAG, INKSCAPE_GROUPMODE, SVG_DEFS_TAG, EMBROIDERABLE_TAGS @@ -122,10 +123,13 @@ class InkstitchExtension(inkex.Effect): def no_elements_error(self): if self.selected: - inkex.errormsg(_("No embroiderable paths selected.")) + # l10n This was previously: "No embroiderable paths selected." + inkex.errormsg(_("Ink/Stitch doesn't know how to work with any of the objects you've selected.") + "\n") else: - inkex.errormsg(_("No embroiderable paths found in document.")) - inkex.errormsg(_("Tip: use Path -> Object to Path to convert non-paths.")) + inkex.errormsg(_("There are no objects in the entire document that Ink/Stitch knows how to work with.") + "\n") + + inkex.errormsg(_("Ink/Stitch only knows how to work with paths. It can't work with objects like text, rectangles, or circles.") + "\n") + inkex.errormsg(_("Tip: select some objects and use Path -> Object to Path to convert them to paths.") + "\n") def descendants(self, node, selected=False): nodes = [] @@ -192,15 +196,7 @@ class InkstitchExtension(inkex.Effect): def uniqueId(self, prefix, make_new_id=True): """Override inkex.Effect.uniqueId with a nicer naming scheme.""" - i = 1 - while True: - new_id = "%s%d" % (prefix, i) - if new_id not in self.doc_ids: - break - i += 1 - self.doc_ids[new_id] = 1 - - return new_id + return generate_unique_id(self.document, prefix) def parse(self): """Override inkex.Effect.parse to add Ink/Stitch xml namespace""" |
