Any tool for translating text inside SVG XML?

Discuss SVG code, accessible via the XML Editor.
Joe
Posts: 13
Joined: Tue Jan 22, 2008 6:03 pm

Any tool for translating text inside SVG XML?

Postby Joe » Fri Jun 08, 2012 5:00 am

Hi folks,

I have a project involving text inside an SVG in Inkscape, which would need to be translated (which is easier to do externally than to edit the SVG in Inkscape directly). True, I can open the XML in any editor and search for the "text" elements and go from there, but this would be rather cumbersome and I might miss some.

But if there would be for instance a script or an external editor with such capabilities, I would be very grateful!
WinXP and mostly latest Inkscape (unless stated otherwise)

Mathieu147
Posts: 55
Joined: Wed May 30, 2012 11:17 pm
Location: Belgium

Re: Any tool for translating text inside SVG XML?

Postby Mathieu147 » Fri Jun 08, 2012 4:48 pm

Hi,

On which system do you plan to do this? If you are on a Unix system like Linux or OS X, I suppose that regular expressions with tools like awk or sed could do the job.

Could you be a little more specific about what you are trying to achieve?

I use Inkscape 0.48 on Ubuntu 12.04.
English is not my natural language so excuse my mistakes.

Joe
Posts: 13
Joined: Tue Jan 22, 2008 6:03 pm

Re: Any tool for translating text inside SVG XML?

Postby Joe » Fri Jun 08, 2012 5:17 pm

I am on WinXP.

What I have in mind is a way to either:

- display and let me edit only the text elements from an SVG file - the best possible solution

- or to highlight the text elements (not the tags around it) so that I am easily able to see and edit them - slower, but also manageable
WinXP and mostly latest Inkscape (unless stated otherwise)

Mathieu147
Posts: 55
Joined: Wed May 30, 2012 11:17 pm
Location: Belgium

Re: Any tool for translating text inside SVG XML?

Postby Mathieu147 » Fri Jun 08, 2012 7:41 pm

Joe wrote:I am on WinXP.

Ha lol it was written in your signature, I didn't pay attention…

Joe wrote:What I have in mind is a way to either:

- display and let me edit only the text elements from an SVG file - the best possible solution

- or to highlight the text elements (not the tags around it) so that I am easily able to see and edit them - slower, but also manageable

Do you know any programming language? XML parsers are avaliable in virtually all programming languages, so it should not be too difficult to loop through all text tags and change their content.

Well, I don't really answer your question I suppose :(

I use Inkscape 0.48 on Ubuntu 12.04.
English is not my natural language so excuse my mistakes.

Joe
Posts: 13
Joined: Tue Jan 22, 2008 6:03 pm

Re: Any tool for translating text inside SVG XML?

Postby Joe » Tue Jun 12, 2012 5:16 pm

Unfortunately I am not proficient in programming (although you have no idea how much I would like to... no time no TIME!!!), so I can only take final solutions...
WinXP and mostly latest Inkscape (unless stated otherwise)

Mathieu147
Posts: 55
Joined: Wed May 30, 2012 11:17 pm
Location: Belgium

Re: Any tool for translating text inside SVG XML?

Postby Mathieu147 » Tue Jun 12, 2012 6:17 pm

Do you have many files to translate, or do you have many languages to translate to, or is/are your file(s) big and complex? If you answer no to all of these questions, you should just use a text editor to search/replace all your texts.

If you answer "yes" to any of these questions, you'd better find a software that will help you, but I don't know if it exists.

I use Inkscape 0.48 on Ubuntu 12.04.
English is not my natural language so excuse my mistakes.

Joe
Posts: 13
Joined: Tue Jan 22, 2008 6:03 pm

Re: Any tool for translating text inside SVG XML?

Postby Joe » Tue Jun 12, 2012 6:21 pm

Thx :)
As I said, that is always the last option...

But now I have an idea - I regularly use Notepad++ which has syntax highlighting capabilities (and pretty advanced). These already contain XML code syntax, so I could ask around Notepad++ forums for a way to trim the XML syntax highlighting to just the text areas (and perhaps graying out all the other stuff)...

Will report my findings :)
WinXP and mostly latest Inkscape (unless stated otherwise)

Mathieu147
Posts: 55
Joined: Wed May 30, 2012 11:17 pm
Location: Belgium

Re: Any tool for translating text inside SVG XML?

Postby Mathieu147 » Tue Jun 12, 2012 6:43 pm

You could also go to a programming forum and ask them to do the programming for you :D

I use Inkscape 0.48 on Ubuntu 12.04.
English is not my natural language so excuse my mistakes.

User avatar
tomh
Posts: 218
Joined: Sat Feb 14, 2009 10:14 pm

Re: Any tool for translating text inside SVG XML?

Postby tomh » Sun Jun 17, 2012 10:28 pm

AndyFitzsimon has put together one tutorial on how to do this, unfortunately having to use the internet archive due to spam problems...

http://web.archive.org/web/200804150923 ... rchives/45

or in Russian... http://linuxgraphics.ru/articles.php?article_id=33

Not sure how much of this you can adapt to work on Windows, but the process is essentially the method used to translate Inkscape itself ( at least after the creation of .po files) and many other open source software projects.

Mathieu147
Posts: 55
Joined: Wed May 30, 2012 11:17 pm
Location: Belgium

Re: Any tool for translating text inside SVG XML?

Postby Mathieu147 » Mon Jun 18, 2012 1:11 am

I was sure I had already seen a blog post about translatable SVG files but couldn't find it anymore. But it's this one! Maybe there is some information in it we can use?

I use Inkscape 0.48 on Ubuntu 12.04.
English is not my natural language so excuse my mistakes.


Return to “SVG / XML Code”