I have a cartoon with multiple layers; among those layers I have a German and an English layer. They have the text in their respective languages. The idea is to hide the German layer and show the English layer and export as an English cartoon or to hide the English layer and show the German layer for a German version of the cartoon. I'd like to script that export.
Here is a part of my SVG file:
<g inkscape:groupmode="layer" id="layer3" inkscape:label="English" style="display:inline"> <text xml:space="preserve" <!-- .... --> id="text3255"> <tspan id="tspan3257">I don't think</tspan> <!-- ... -->
<g inkscape:groupmode="layer" id="layer4" inkscape:label="German" style="display:none"> <text xml:space="preserve" <!-- ... --> id="text3284"> <tspan id="tspan3286">Ich glaube nicht,</tspan> <!-- ... -->
I've seen https://stackoverflow.com/questions/9652573/inkscape-command-line-programming and tried this command (and plenty of variations to it):
inkscape -z --file=cartoon.svg --select=English --verb=LayerHideAll --select=German --verb=LayerShowAll --export-png=cartoon-de.png --export-area-drawing
But I keep getting the English text, probably because when I saved the file, the English layer was visible and the German layer wasn't.
I've also tried selecting the layers by their IDs (in the code above layer3 and layer4, respectively), and selecting the actual
<text> elements; I've tried various combinations of Inkscape verbs. But no luck either.
How can I script this export, hiding or showing the language layer as needed? Can I do this with Inkscape verbs or should I work with the XML and try setting the style attribute to display:inline or display:none?