Merge TXML files, and then split them again
Thread poster: Samuel Murray

Samuel Murray  Identity Verified
Netherlands
Local time: 01:11
Member (2006)
English to 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 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]


 

Samuel Murray  Identity Verified
Netherlands
Local time: 01:11
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
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  Identity Verified
Netherlands
Local time: 01:11
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
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  Identity Verified
Netherlands
Local time: 01:11
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
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]


 

yongzhou
Local time: 07:11
Chinese to 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-24 14:21 GMT]


 

Samuel Murray  Identity Verified
Netherlands
Local time: 01:11
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
@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.


 

yongzhou
Local time: 07:11
Chinese to 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.


 

yongzhou
Local time: 07:11
Chinese to 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  Identity Verified
Netherlands
Local time: 01:11
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
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  Identity Verified
Netherlands
Local time: 01:11
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
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

Advanced search


Translation news related to Wordfast





PerfectIt consistency checker
Faster Checking, Greater Accuracy

PerfectIt helps deliver error-free documents. It improves consistency, ensures quality and helps to enforce style guides. It’s a powerful tool for pro users, and comes with the assurance of a 30-day money back guarantee.

More info »
WordFinder Unlimited
For clarity and excellence

WordFinder is the leading dictionary service that gives you the words you want anywhere, anytime. Access 260+ dictionaries from the world's leading dictionary publishers in virtually any device. Find the right word anywhere, anytime - online or offline.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search