gettext equivalent for SVG files?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

gettext equivalent for SVG files?

Chris Leonard-3
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
idea would be to improve L10n by parsing SVG files and creating POT
files that could be hosted in Pootle.  This is really only useful if
there is a command-line method so it can be scripted up as part of a
localized build process.

TIA for any info you may have on this.

cjl
Sugar Labs Translation Team Coordinator

On Thu, Apr 5, 2012 at 2:54 AM,  <[hidden email]> wrote:

> Hi
>
> it was suggested in IRC that this list was the best place for asynchronous contribution to the sprint, so I have subscribed.
>
> my understanding from IRC was that the best format for the master document (from which secondary documents such as web sites, in Activity help, print book etc could be derived) is minimally formatted html with svg illustrations (svg because you can automatically separate the text and translate it)
>
> thanks all
> I look forward to contributing
> Tony
> _______________________________________________
> Library mailing list
> [hidden email]
> http://lists.laptop.org/listinfo/library
_______________________________________________
Library mailing list
[hidden email]
http://lists.laptop.org/listinfo/library
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gettext equivalent for SVG files?

forster@ozonline.com.au
> 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


> idea would be to improve L10n by parsing SVG files and creating POT
> files that could be hosted in Pootle.  This is really only useful if
> there is a command-line method so it can be scripted up as part of a
> localized build process.
>
> TIA for any info you may have on this.
>
> cjl
> Sugar Labs Translation Team Coordinator

_______________________________________________
Library mailing list
[hidden email]
http://lists.laptop.org/listinfo/library
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gettext equivalent for SVG files?

Chris Leonard-3
On Thu, Apr 5, 2012 at 4:42 PM,  <[hidden email]> 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.

cjl
_______________________________________________
Library mailing list
[hidden email]
http://lists.laptop.org/listinfo/library
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gettext equivalent for SVG files?

Bruno Coudoin
Le jeudi 05 avril 2012 à 17:30 -0400, Chris Leonard a écrit :

> On Thu, Apr 5, 2012 at 4:42 PM,  <[hidden email]> 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.


_______________________________________________
Library mailing list
[hidden email]
http://lists.laptop.org/listinfo/library
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gettext equivalent for SVG files?

Chris Leonard-3
On Thu, Apr 5, 2012 at 6:59 PM, Bruno Coudoin <[hidden email]> wrote:

> Le jeudi 05 avril 2012 à 17:30 -0400, Chris Leonard a écrit :
>> On Thu, Apr 5, 2012 at 4:42 PM,  <[hidden email]> 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
_______________________________________________
Library mailing list
[hidden email]
http://lists.laptop.org/listinfo/library
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gettext equivalent for SVG files?

Bruno Coudoin
Le jeudi 05 avril 2012 à 19:43 -0400, Chris Leonard a écrit :
> 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 

Ouch, I was not aware of these technologies. I need to get out of
GCompris and look around. The technology is definitely improving and
brings interesting opportunities.

Bruno.



_______________________________________________
Library mailing list
[hidden email]
http://lists.laptop.org/listinfo/library
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gettext equivalent for SVG files?

Chris Leonard-3
In reply to this post by Chris Leonard-3
On Fri, Apr 6, 2012 at 2:45 PM, Bruno Coudoin
<[hidden email]> wrote:

> Le jeudi 05 avril 2012 à 19:43 -0400, Chris Leonard a écrit :
>> 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
>
> Ouch, I was not aware of these technologies. I need to get out of
> GCompris and look around. The technology is definitely improving and
> brings interesting opportunities.
>
> Bruno.

Yeah it is interesting what you can learn about when you hang out in
other people's neighborhood.  I heard about this stuff on the
gnome-i18n list.

ITS tool sounds real promising, but I haven't played with it,

http://itstool.org/

the interesting thing is that Shaun McCance is also the guy behind
Mallard (embedded docs) that is used by Gnome-docs for generating and
localizing embedded help pages.

cjl
_______________________________________________
Library mailing list
[hidden email]
http://lists.laptop.org/listinfo/library
Loading...