[OLPC library] gettext equivalent for SVG files?

Bruno Coudoin bruno.coudoin at free.fr
Thu Apr 5 18:59:03 EDT 2012

Le jeudi 05 avril 2012 à 17:30 -0400, Chris Leonard a écrit :
> On Thu, Apr 5, 2012 at 4:42 PM,  <forster at ozonline.com.au> wrote:
> >> Tony,
> >>
> >> Do you know a command-line tool for pulling the text out of an SVG (in
> >> nearly any text format) and for substituting in another string?  The
> >
> > Sorry, I know nothing
> I think if the SVG uses proper XML markup to tag teh localizable
> strings, than it might be possible to do this with itstool, but I've
> never seen an example.


I made a little test, is you create an svg file with inkscape and put an
'hello world' text in it, it will create this:
<text ..snip props.. >Hello world</text>

If you try to duplicate this line and adding the lang property:
<text xml:lang="en" ..snip props.. >Hello world</text>
<text xml:lang="fr" ..snip props.. >Bonjour le monde</text>

Then you open it in inkscape and both strings are displayed. I assume
that it does not handle the lang property.

It should be possible to create an svg.in file in which you underline
elements like this : <_text>Hello world</_text>. Then intltool will
extract the text to the po file for translation. But then it will create
you an .svg file with all the elements marked with xml:lang="xx"
properties. You may hack this and post process them a little bit further
to create a single .svg file per language.


More information about the Library mailing list