index a9873e2fcfe2c7cebe30fb5d98d60bc451a053c7..cf41ad24f5c6c2fc7a60d67631e3b4bfdbd684b6 100755 (executable)
# We will use the inkex module with the predefined Effect base class.
import inkex
+import gettext
+_ = gettext.gettext
class JessyInk_AutoTexts(inkex.Effect):
def __init__(self):
def effect(self):
# Check version.
- scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.1']", namespaces=inkex.NSS)
+ scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.5']", namespaces=inkex.NSS)
if len(scriptNodes) != 1:
- sys.stderr.write("The JessyInk script is not installed in this SVG file or has a different version than the JessyInk extensions. Please select \"install/update...\" from the \"JessyInk\" sub-menu of the \"Effects\" menu to install or update the JessyInk script.\n\n")
+ inkex.errormsg(_("The JessyInk script is not installed in this SVG file or has a different version than the JessyInk extensions. Please select \"install/update...\" from the \"JessyInk\" sub-menu of the \"Extensions\" menu to install or update the JessyInk script.\n\n"))
if len(self.selected) == 0:
- sys.stderr.write("To assign an effect, please select an object.\n")
+ inkex.errormsg(_("To assign an effect, please select an object.\n\n"))
for id, node in self.selected.items():
nodes = node.xpath("./svg:tspan", namespaces=inkex.NSS)
if len(nodes) != 1:
- sys.stderr.write("Node with id '" + str(id) + "' is not a suitable text node and was therefore ignored.\n")
+ inkex.errormsg(_("Node with id '{0}' is not a suitable text node and was therefore ignored.\n\n").format(str(id)))
else:
if self.options.autoText == "slideTitle":
nodes[0].set("{" + inkex.NSS["jessyink"] + "}autoText","slideTitle")