Need help - XML (TMX) Editor Thread poster: Freigeist
|
Hello everyone,
I have the following problem. I have a bunch of TMX files here with 3 languages and I want to remove one language completely and swap the sorting of the two remaining ones. As there are thousands of entries that need to be edited, I need to find an automated solution (for Windows). Each translation segment looks like this:
...
(tu tuid="STRINGID">)
(note)STRING NOTE(/note)
(tuv xml:lang="de")
(seg)DE TEXT(/seg)... See more Hello everyone,
I have the following problem. I have a bunch of TMX files here with 3 languages and I want to remove one language completely and swap the sorting of the two remaining ones. As there are thousands of entries that need to be edited, I need to find an automated solution (for Windows). Each translation segment looks like this:
...
(tu tuid="STRINGID">)
(note)STRING NOTE(/note)
(tuv xml:lang="de")
(seg)DE TEXT(/seg)
(/tuv)
(tuv xml:lang="en")
(seg)EN TEXT(/seg)
(/tuv)
(tuv xml:lang="fr")
(seg)FR TEXT(/seg)
(/tuv)
(/tu)
...
(The brackets are of course angle brackets, but it's not displayed here so I changed it)
What I want to do now is get rid of the "de" segment and all its content, and swapping the sorting of the remaining two entries so fr is on top and en follows. I tried to use regular expressions with notepad++ to achieve this but I just can't figure out how to do it. Does anyone has an idea to do this? I tried using Olifant but there you can't change the sorting and it removes other information of the XML file (like ).
Thanks in advance!
[Bearbeitet am 2011-10-10 10:42 GMT]
[Bearbeitet am 2011-10-10 10:46 GMT] ▲ Collapse | | | |
It is free, you will find the download link here:
http://okapi.sourceforge.net/downloads.html
Once you load the file into Olifant, you will be able to to delete the unwanted language in the file's properties.
Hope this helps.
Regards,
Piotr | | | | Adam Łobatiuk Poland Local time: 00:53 Member (2009) English to Polish + ... | Use a CAT tool | Oct 10, 2011 |
Most CAT tools support TMX, so you should be able to create a new FR-EN TM, import the TMX as is, and then export it again. | | | |
You could do this in Notepad+ but there is no need to do it if you want to use the tmx in a CAT tool. CATs are smart enough to ignore the superfluous third language and they are smart enough to import the languages correctly.
Just create a fr-en TM and import.
If you really need to do this for some odd reason, I can try and help get a regex together fot you.
[Edited at 2011-10-11 08:15 GMT] | | |
|
|
|
I am sure the problem can be solved without creating a regex, easily and safely. However, if you are still interested, here is a regex which seems to work. It is for Word, because I am a bit more familiar with regex in Word, than in Notepad++.
Go to Find/Replace and check Wildcard checkbox.
To delete "de” part:
Find:
\<tuv xml:lang="de"\>^13\<seg\>*\</seg\>^13\</tuv\>^13
Replace with:
nothing
To chang... See more I am sure the problem can be solved without creating a regex, easily and safely. However, if you are still interested, here is a regex which seems to work. It is for Word, because I am a bit more familiar with regex in Word, than in Notepad++.
Go to Find/Replace and check Wildcard checkbox.
To delete "de” part:
Find:
\<tuv xml:lang="de"\>^13\<seg\>*\</seg\>^13\</tuv\>^13
Replace with:
nothing
To change the order of „en” and „fr”:
Find:
(\<tuv xml:lang="en"\>^13\<seg\>*\</seg\>^13\</tuv\>^13)(\<tuv xml:lang="fr"\>^13\<seg\>*\</seg\>^13\</tuv\>^13)
Replace with:
\2\1
Note the space between each tuv and xml: tuv_xml.
If there are soft breaks between the lines, use ^10 instead of ^13.
After the Find/Replace operations I got this - hope this is what you need:
<tu tuid="STRINGID">
<note>STRING NOTE</note>
<tuv xml:lang="fr">
<seg>FR TEXT</seg>
</tuv>
<tuv xml:lang="en">
<seg>EN TEXT</seg>
</tuv>
</tu> ▲ Collapse | | | | | | To report site rules violations or get help, contact a site moderator: You can also contact site staff by submitting a support request » Need help - XML (TMX) Editor | Trados Business Manager Lite | Create customer quotes and invoices from within Trados Studio
Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.
More info » |
| | Protemos translation business management system | Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!
The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |