Tool that can edit only the target segments in a TMX file?
Thread poster: Erik Wallace
Erik Wallace
Erik Wallace  Identity Verified
Member (2010)
English to Norwegian (Bokmal)
+ ...
Aug 6, 2011

Good morning/afternoon/evening everyone,

I am in need of a tool that allow you to edit only the target segments of a TMX, for instance with a replace all. As this can not be done in NotePad etc (replace all is, of course, possible - but it will replace all matches from the source segment as well) I was hoping an editor specially designed for TMX was available, giving me just the function I need.

Does anyone know of such an editor/program? If so, thank you very much in
... See more
Good morning/afternoon/evening everyone,

I am in need of a tool that allow you to edit only the target segments of a TMX, for instance with a replace all. As this can not be done in NotePad etc (replace all is, of course, possible - but it will replace all matches from the source segment as well) I was hoping an editor specially designed for TMX was available, giving me just the function I need.

Does anyone know of such an editor/program? If so, thank you very much in advance for sharing.



Kindest,



Erik
Collapse


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 03:52
Member (2006)
English to Afrikaans
+ ...
Virtaal Aug 6, 2011

Erik Wallace wrote:
I am in need of a tool that allow you to edit only the target segments of a TMX, for instance with a replace all.


I'm not sure if Virtaal supports replace-all.
http://translate.sourceforge.net/wiki/virtaal/index


 
Erik Wallace
Erik Wallace  Identity Verified
Member (2010)
English to Norwegian (Bokmal)
+ ...
TOPIC STARTER
Thank you for the suggestion, Samuel Aug 6, 2011

Virtaal does support replace all, it only edits the target segments? Looks that way so far, but haven't tested it enough yet.


Erik

*Unfortunately it didn't work the way I had hoped.

[Edited at 2011-08-06 20:56 GMT]


 
Selcuk Akyuz
Selcuk Akyuz  Identity Verified
Türkiye
Local time: 04:52
English to Turkish
+ ...
REGEX Aug 6, 2011

Hi Erik,

Perhaps you can do it with Notepad++ using REGEX. It works at least with Find command.

Selcuk

---------------------

You can also use Olifant but it may change date attributes, that is why I suggested a powerful text editor with REGEX support.


[Edited at 2011-08-06 21:00 GMT]


 
Erik Wallace
Erik Wallace  Identity Verified
Member (2010)
English to Norwegian (Bokmal)
+ ...
TOPIC STARTER
Hi Selcuk, Aug 6, 2011

Thank you for your suggestion, but I already have NotePad - and I already can perform replace all in the document. What I can not do is to replace all only in the target segments, without touching the source.


Erik


 
Erik Wallace
Erik Wallace  Identity Verified
Member (2010)
English to Norwegian (Bokmal)
+ ...
TOPIC STARTER
Olifant seemed to do the trick Aug 6, 2011

Thanks a lot, Selcuk

 
Selcuk Akyuz
Selcuk Akyuz  Identity Verified
Türkiye
Local time: 04:52
English to Turkish
+ ...
It depends on the xml structure Aug 6, 2011

Erik Wallace wrote:

Thank you for your suggestion, but I already have NotePad - and I already can perform replace all in the document. What I can not do is to replace all only in the target segments, without touching the source.


Erik


Each CAT tools creates a different structure, and source and target segments are marked with different identifiers. Even in that case a text editor capable of multiline find and replace operations (e.g. UltraEdit) can do it.


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 03:52
Member (2006)
English to Afrikaans
+ ...
jEdit Aug 6, 2011

Selcuk Akyuz wrote:
Perhaps you can do it with Notepad++ using REGEX.


Yup. jEdit too... here are instructions (among other things):

http://leuce.com/autoit/bulkfindreplace.zip


 
kalap (X)
kalap (X)
Wordfast and Excel Aug 6, 2011

Convert the tmx into a Wordfast .txt, copy this one from Notepad into an Excel file, do the replace sessions in the target column, save into txt and convert back into tmx. Works fine.

 
FarkasAndras
FarkasAndras  Identity Verified
Local time: 03:52
English to Hungarian
+ ...
Solutions Aug 7, 2011

kalap wrote:

Convert the tmx into a Wordfast .txt, copy this one from Notepad into an Excel file, do the replace sessions in the target column, save into txt and convert back into tmx. Works fine.


That conversion could be lossy, i.e. you'll lose some (meta)data in the process. You'll probably also need to install Wordfast to do this.


That looks like it'll fail if the TMX wasn't generated by OmegaT and doesn't have the line breaks where the script expects them to be. It's better to normalize line breaks instead of making assumptions (see below).

Erik Wallace wrote:

Thank you for your suggestion, but I already have NotePad - and I already can perform replace all in the document. What I can not do is to replace all only in the target segments, without touching the source.


Then you only need to use the right s&r command to get what you want.
So:
- Install Notepad++
- Remove line breaks from the TMX (say, in MS Word)
- Replace <tuv xml:lang with \n<tuv xml:lang
- Replace </seg> with </seg>\n
- Do your replacement. E.g. replace (<tuv xml:lang="NL">.*)foo with \1bar
This will replace the last occurrence of foo with bar in each NL segment.

It'd be pretty easy to automate this in Perl, and support replacing multiple occurrences of the term within the same segment.

Of course, using Olifant or Trados Studio is probably a better idea.


[Edited at 2011-08-07 11:06 GMT]


 
MikeTrans
MikeTrans
Germany
Local time: 03:52
Italian to German
+ ...
Olifant... Aug 7, 2011

Hi,
with Olifant you can flag any present attribute before making changes with the Search/Replace tools. In your case you simply tick the Target Language box AND UNTICK any other. You can also use RegEx expressions.

For more complicated changes, you can set a filter before and apply only from there you have then to tick the "flag" box. There are about 10 common RegEx examples provided which you can chose in a scroll-down.

Finally there is a SQL filter implementati
... See more
Hi,
with Olifant you can flag any present attribute before making changes with the Search/Replace tools. In your case you simply tick the Target Language box AND UNTICK any other. You can also use RegEx expressions.

For more complicated changes, you can set a filter before and apply only from there you have then to tick the "flag" box. There are about 10 common RegEx examples provided which you can chose in a scroll-down.

Finally there is a SQL filter implementation.

If you use "Export" and "Default Syle", without notes etc.. (untick all 3), then all dates and all attributes will be preserved.

Mike
Collapse


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Tool that can edit only the target segments in a TMX file?






Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »
Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »