Merge TXML files, and then split them again
论题张贴者: Samuel Murray
Samuel Murray
Samuel Murray  Identity Verified
荷兰
Local time: 05:46
正式会员 (自2006)
English英语译成Afrikaans南非语
+ ...
Apr 20, 2015

Hello everyone

As far as I could tell, WFP does not have a function to merge TXML files in such a way that you can edit the merged file and use bilingual review on the merged file, and then split the file again into its original TXML files. Does anyone know of such a feature in WFP?

In the mean time, I've written a small
... See more
Hello everyone

As far as I could tell, WFP does not have a function to merge TXML files in such a way that you can edit the merged file and use bilingual review on the merged file, and then split the file again into its original TXML files. Does anyone know of such a feature in WFP?

In the mean time, I've written a small pair of scripts that do just that:
http://www.leuce.com/autoit/TXML%20MS%20scripts.zip
...and I would appreciate some testers.

Samuel


[Edited at 2015-04-20 11:30 GMT]
Collapse


 
Samuel Murray
Samuel Murray  Identity Verified
荷兰
Local time: 05:46
正式会员 (自2006)
English英语译成Afrikaans南非语
+ ...
主题发起人
II Apr 20, 2015

Samuel Murray wrote:
In the mean time, I've written a small pair of scripts that do just that:
http://www.leuce.com/autoit/TXML%20MS%20scripts.zip


Added1: I uploaded a new version that takes an LF x CRLF quirk of WFP into account.

Added2: I changed the file name, because some browsers seem to have a problem with a "+" in the file name.


 
Samuel Murray
Samuel Murray  Identity Verified
荷兰
Local time: 05:46
正式会员 (自2006)
English英语译成Afrikaans南非语
+ ...
主题发起人
III May 12, 2015

Samuel Murray wrote:
In the mean time, I've written a small pair of scripts that do just that:
http://www.leuce.com/autoit/TXML%20MS%20scripts.zip
...and I would appreciate some testers.


I originally assumed that the first translatable block in a TXML file would be numbered "0" but it turns out not to be so. I uploaded a new version that no long makes that assumption.

By the way, you can also merge TXML files using the Extract Freq function in WFP itself, but that function strips out all existing translations, so it's not useful for translating a partially translated file or for proofreading a translated file.



[Edited at 2015-05-12 07:30 GMT]


 
Samuel Murray
Samuel Murray  Identity Verified
荷兰
Local time: 05:46
正式会员 (自2006)
English英语译成Afrikaans南非语
+ ...
主题发起人
IV May 24, 2015

Samuel Murray wrote:
In the mean time, I've written a small pair of scripts that do just that:
http://www.leuce.com/autoit/TXML%20MS%20scripts.zip


Had 20 tiny TXML files with "skeletons" in them this week, so I updated the scripts again (updated version also uploaded to same download location). They're a life-saver -- I don't know why WFP doesn't have this feature built-in.



[Edited at 2015-05-24 08:25 GMT]


 
Yong-Zho Zhang
Yong-Zho Zhang
Local time: 11:46
Chinese汉语译成English英语
+ ...
Only support en-af language? May 24, 2015

I ran the Merge script to combine 4 txml files into one.
When I try to open it, an alert shows "TXML you attempted to open has en-af language....."
Then I had to choose to create a new project, in the above language.
No others are available, as it's greyed out.
And then the next time, when I try to open the TXML again, ERROR Alert: "Invalid format document..."

Could this be solved? Thank you, this will be a great tool, if it works.

[Edited at 2015-05-2
... See more
I ran the Merge script to combine 4 txml files into one.
When I try to open it, an alert shows "TXML you attempted to open has en-af language....."
Then I had to choose to create a new project, in the above language.
No others are available, as it's greyed out.
And then the next time, when I try to open the TXML again, ERROR Alert: "Invalid format document..."

Could this be solved? Thank you, this will be a great tool, if it works.

[Edited at 2015-05-24 14:21 GMT]
Collapse


 
Samuel Murray
Samuel Murray  Identity Verified
荷兰
Local time: 05:46
正式会员 (自2006)
English英语译成Afrikaans南非语
+ ...
主题发起人
@Yongzhou May 24, 2015

yongzhou wrote:
When I try to open it, an alert shows "TXML you attempted to open has en-af language....."


Aah, thanks for that... you could simply edit the TXML file yourself and change the "locale" and "targetlocale" values at the top of the file, or you can try the updated version which I've just uploaded, which specifically asks for the language codes (it should say "version 0.5" when you run it).

And then the next time, when I try to open the TXML again, ERROR Alert: "Invalid format document..."


If you can send me the TXML file, I can have a look. But try the updated version first -- the one that asks for the language codes. The script works for me, but then, I had to fix it four times in the past few weeks whenever I discover something that breaks it.


 
Yong-Zho Zhang
Yong-Zho Zhang
Local time: 11:46
Chinese汉语译成English英语
+ ...
language solved but still error opening May 25, 2015

Thank you, The language problem is gone. But when double-clicking to open the merged txml, it still go: "Invalid document format..." and won't open.

I can sent you the txml if you'd like.


 
Yong-Zho Zhang
Yong-Zho Zhang
Local time: 11:46
Chinese汉语译成English英语
+ ...
Split first than merge May 25, 2015

Is this possible too? I know WFP IS capable of this. But it only allow you to split every xx TUs, and no option to split only into 2 pieces.

I would need an option to split after xx TUs into 2 halves, A and B.
Then later I would need split B into B-1 and B-2, again breaking at whatever point we specify.
Then finally, after all separate works are done, they can be merged back accurately to the original whole.


 
Samuel Murray
Samuel Murray  Identity Verified
荷兰
Local time: 05:46
正式会员 (自2006)
English英语译成Afrikaans南非语
+ ...
主题发起人
First split within WFP May 25, 2015

yongzhou wrote:
I know WFP IS capable of this. But it only allow you to split every xx TUs, and no option to split only into 2 pieces. I would need an option to split after xx TUs into 2 halves, A and B.


Yes, I saw that WFP can split by number of segments but does not have the option to split into X number of pieces. This isn't something that I can easily program, unfortunately. I'm afraid you'd have to open each TXML file and then see how many segments there are, and then tell WFP to split every so many segments.


 
Samuel Murray
Samuel Murray  Identity Verified
荷兰
Local time: 05:46
正式会员 (自2006)
English英语译成Afrikaans南非语
+ ...
主题发起人
Update May 25, 2015

yongzhou wrote:
But when double-clicking to open the merged txml, it still go: "Invalid document format..." and won't open. ... I can sent you the txml if you'd like.


Just an update on what happened:

Yongzhou sent me some sample files, and I determined that he had placed the previously merged TXML file in the same folder as the other TXML files when he performed the second merge, which resulted in that merged file being invalid as well. It is important to note that the script processes all TXML files in the folder where the script is, as well as all TXML files in all subfolders of that folder.

Yongzhou also sent me the original files, and I was able to merge them so that both WFP on my computer and WFP on Yongzhou's computer could open it. However, Yongzhou reported that he is still unable to merge the files himself (even after making sure that no other TXML files are in the same folder as the script), in such a way that WFP accepts the file.

It would appear to me that on Yongzhou's computer, my script reads two of the five TXML files using the wrong file encoding (not as UTF8N but something else, apparently). TXML files are in UTF8 without byte order mark.


 


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


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

Merge TXML files, and then split them again







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! »
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 »