Creating a new file-based translation memory form an existing translation memory via the API?

Hiya,

I have a bunch of file-based translation memories with customized language resource settings (segmentation rules, custom date and time formats, etc.).

I would like to create new empty file-based translation memories based on each of those existing translation memories. 

In Studio, I would just open each of the translation memories and use the ·"New translation memory from".

As I have quite a few, I would rather automate the process.

I was looking at the SDK and I could not find any method create a TM based on an existing TM, using the  var tm = new FileBasedTranslationMemory(....) 

It seems as if one would have to open the existing TM, loop through the required settings to read them and then create new blank TM and provide the settings read from the other TM as parameters.

Isn't there a more straightforward approach? Something like  "CreateTMbasedOnAnotherTM (newTMpath, OldTMPath) or similar. Just something to clone a TM easily.

I guess I could automatically make a copy of those TMs and automatically delete all translation units but there is bug in file-based in which TUs are not really deleted and the file size remains large even after deleting all TUs.

Thanks!

Daniel

emoji
Parents Reply Children
No Data