[OLPC library] gettext equivalent for SVG files?

Chris Leonard cjlhomeaddress at gmail.com
Thu Apr 5 19:43:05 EDT 2012


On Thu, Apr 5, 2012 at 6:59 PM, Bruno Coudoin <bruno.coudoin at free.fr> wrote:
> 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.
>
> Hi,
>
> 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.
>
> Bruno.
>
>

Thanks Bruno,

I think itstool and XLIFF format may be the keys, XLIFF is easily
converted back and forth to POT by Translate Toolkit.  I'll look into
it more.  It seems we'll not be getting SVG screenshots this time, but
it will be good to figure out for other content projects or
activities.

http://www.w3.org/TR/SVGTiny12/i18n.html


cjl


More information about the Library mailing list