To inject sdlxliff file path into TM's TU

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Trados has very nice tool called "RecordSourceTU" already.
This code considering the same goal but with slightly different scenario.
It injects sdlxliff's full path information (only) into TM afterwards.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1. You have finished a project which has sdlxliff and TM of course
2. But, its TM lacks sdlxliff's information (in this case Full path) within it
3. This code select a sdlxliff and a TM
4. It checks sdlxliff TU's time window - the lastest and the oldest time info
5. It checks TM TU's same information and if it fits (within the time window), injects sdlxliff's info into it
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Code is quite simple and elementary stage, just confirmed it works.
You have to put "sqlite3.dll" at the same folder with this code. This file comes from SQLite site.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Enjoy..

..

.

Trados Studio interface showing a project with translation results and an error message 'No TM Database.'

..

.


Attached, AutoHotkey source code and sqlite.dll

TestedSuccessfully.zip



Generated Image Alt-Text
[edited by: Trados AI at 4:30 AM (GMT 0) on 5 Mar 2024]
Parents Reply Children
  • You could make your own one quite easily.

    I would agree with this... as long as you do know how to develop.  The problems you may have, and it's one we had when this app was developed, is that sometimes it's simply not possible to do what seems very obvious because we have no event to use.  In this case I remember when we did it that we actually don't know that we are in a different file when the files are merged.  Sounds silly and illogical because you can plainly see you are in a different file, but you have to remember that we are constrained by what the API allows us to access when working with a plugin in this way.

    Having said this we have made considerable improvements under the hood of the API in the last few years so it's probably worth revisiting this one.  So we'll add to the list to take a look and see if we can improve it in the current versions of the software.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji