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!
Any tool for translating text inside SVG XML?
Any tool for translating text inside SVG XML?
WinXP and mostly latest Inkscape (unless stated otherwise)
-
- Posts: 55
- Joined: Wed May 30, 2012 11:17 pm
- Location: Belgium
Re: Any tool for translating text inside SVG XML?
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?
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.
Re: Any tool for translating text inside SVG XML?
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
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)
-
- Posts: 55
- Joined: Wed May 30, 2012 11:17 pm
- Location: Belgium
Re: Any tool for translating text inside SVG XML?
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.
Re: Any tool for translating text inside SVG XML?
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)
-
- Posts: 55
- Joined: Wed May 30, 2012 11:17 pm
- Location: Belgium
Re: Any tool for translating text inside SVG XML?
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.
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.
Re: Any tool for translating text inside SVG XML?
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
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)
-
- Posts: 55
- Joined: Wed May 30, 2012 11:17 pm
- Location: Belgium
Re: Any tool for translating text inside SVG XML?
You could also go to a programming forum and ask them to do the programming for you
I use Inkscape 0.48 on Ubuntu 12.04.
English is not my natural language so excuse my mistakes.
Re: Any tool for translating text inside SVG XML?
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.
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.
-
- Posts: 55
- Joined: Wed May 30, 2012 11:17 pm
- Location: Belgium
Re: Any tool for translating text inside SVG XML?
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.